Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/invisible/core_ext.rb
Instance Method Summary collapse
-
#symbolize_keys ⇒ Object
Return a new hash with all keys converted to symbols.
Instance Method Details
#symbolize_keys ⇒ Object
Return a new hash with all keys converted to symbols.
5 6 7 8 9 10 |
# File 'lib/invisible/core_ext.rb', line 5 def symbolize_keys inject({}) do |, (key, value)| [(key.to_sym rescue key) || key] = value end end |