Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/core_ext/hash.rb
Instance Method Summary collapse
Instance Method Details
#symbolize_keys ⇒ Object
2 3 4 5 6 7 |
# File 'lib/core_ext/hash.rb', line 2 def symbolize_keys inject({}) do |, (key, value)| [(key.to_sym rescue key) || key] = value end end |
#symbolize_keys! ⇒ Object
8 9 10 |
# File 'lib/core_ext/hash.rb', line 8 def symbolize_keys! self.replace(self.symbolize_keys) end |