Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/heroku/kensa/okjson-support.rb
Instance Method Summary collapse
Instance Method Details
#stringify_keys ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/heroku/kensa/okjson-support.rb', line 2 def stringify_keys new_hash = {} each do |key, value| case value when Hash value = value.stringify_keys when Array value = value.map { |v| v.stringify_keys if v.is_a? Hash } end new_hash[key.to_s] = value end new_hash end |