Module: UtilityPack::CoreExtensions::Hash::ClassMethods

Included in:
Hash
Defined in:
lib/utility_pack/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#transform_keys_to_symbols(value) ⇒ Object



10
11
12
13
14
# File 'lib/utility_pack/core_ext/hash.rb', line 10

def transform_keys_to_symbols(value)
  return value if not value.is_a?(::Hash)
  hash = value.inject({}){|memo,(k,v)| memo[k.to_sym] = self.transform_keys_to_symbols(v); memo}
  return hash
end