Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#symbolize_keysObject



3
4
5
6
7
8
# File 'lib/kns_email_endpoint/core_extensions/hash.rb', line 3

def symbolize_keys
  inject({}) do |options, (key, value)|
    options[(key.to_sym rescue key) || key] = value
  options
  end
end

#symbolize_keys!Object



10
11
12
# File 'lib/kns_email_endpoint/core_extensions/hash.rb', line 10

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