Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#symbolize_keys!Object



2
3
4
5
6
7
8
9
10
# File 'lib/juggernaut/utils.rb', line 2

def symbolize_keys!
  keys.each do |key|
    unless key.is_a?(Symbol) || (new_key = key.to_sym).nil?
      self[new_key] = self[key]
      delete(key)
    end
  end
  self
end