Class: Hash

Inherits:
Object
  • 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
  inject({}) { |result, (key, value)|
    value = value.deep_stringify_keys if value.is_a?(Hash)
    result[(key.to_s rescue key) || key] = value
    result
  }
end