Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/taps/monkey.rb
Instance Method Summary collapse
Instance Method Details
#symbolize_keys ⇒ Object
2 3 4 5 6 7 |
# File 'lib/taps/monkey.rb', line 2 def symbolize_keys inject({}) do |, (key, value)| [(key.to_sym rescue key) || key] = value end end |
#symbolize_keys! ⇒ Object
9 10 11 |
# File 'lib/taps/monkey.rb', line 9 def symbolize_keys! self.replace(symbolize_keys) end |
#symbolize_recursively! ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/taps/monkey.rb', line 13 def symbolize_recursively! self.replace(symbolize_keys) self.each do |k, v| if v.kind_of?(Hash) v.symbolize_keys! end end end |