Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/amee/core-extensions/hash.rb
Overview
:title: Class: Hash
Instance Method Summary collapse
-
#recursive_symbolize_keys ⇒ Object
Return a new instance of Hash which represents the same data as
self
but with all keys - including those of sub-hashes - symbolized.
Instance Method Details
#recursive_symbolize_keys ⇒ Object
Return a new instance of Hash which represents the same data as self
but with all keys - including those of sub-hashes - symbolized
11 12 13 14 15 16 17 |
# File 'lib/amee/core-extensions/hash.rb', line 11 def recursive_symbolize_keys new_hash = {} self.each_pair do |k,v| new_hash[k.to_sym] = value_or_symbolize_value(v) end new_hash end |