Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/cloud_party.rb
Class Method Summary collapse
-
.transform_keys_to_symbols(value) ⇒ Object
take keys of hash and transform those to a symbols.
Class Method Details
.transform_keys_to_symbols(value) ⇒ Object
take keys of hash and transform those to a symbols
16 17 18 19 20 |
# File 'lib/cloud_party.rb', line 16 def self.transform_keys_to_symbols(value) return value if not value.is_a?(Hash) hash = value.inject({}){|memo,(k,v)| memo[k.to_sym] = Hash.transform_keys_to_symbols(v); memo} return hash end |