Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/hash.rb

Instance Method Summary collapse

Instance Method Details

#symbolize_keys!Object



2
3
4
5
6
7
# File 'lib/hash.rb', line 2

def symbolize_keys!
  replace(inject({}) do |hash,(key,value)|
    hash[key.to_sym] = value.is_a?(Hash) ? value.symbolize_keys! : value
    hash
  end)
end