class Hash

Public Instance Methods

stringify_keys() click to toggle source

Stringify the keys in the hash. Returns a new hash.

# File lib/hydra/hash.rb, line 3
def stringify_keys
  inject({}) do |options, (key, value)|
    options[key.to_s] = value
    options
  end
end
stringify_keys!() click to toggle source

Stringify the keys in the hash in place.

# File lib/hydra/hash.rb, line 10
def stringify_keys!
 keys.each do |key|
   self[key.to_s] = delete(key)
 end
 self
end