Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#deep_stringify_keysObject



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

def deep_stringify_keys
  new_hash = {}
  self.each do |key, value|
    new_hash.merge!(key.to_s => (value.is_a?(Hash) ? value.deep_stringify_keys : value))
  end
  new_hash
end