Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#symbolize_keysObject



4
5
6
7
8
9
# File 'lib/utility.rb', line 4

def symbolize_keys
  self.inject({}) do |initial, (k, v)|
    initial[k.to_sym] = v
    initial
  end
end

#symbolize_keys!Object



11
12
13
# File 'lib/utility.rb', line 11

def symbolize_keys!
  self.replace(self.symbolize_keys)
end