Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/amee/core-extensions/hash.rb

Overview

:title: Class: Hash

Instance Method Summary collapse

Instance Method Details

#recursive_symbolize_keysObject

Return a new instance of Hash which represents the same data as self but with all keys - including those of sub-hashes - symbolized



11
12
13
14
15
16
17
# File 'lib/amee/core-extensions/hash.rb', line 11

def recursive_symbolize_keys
  new_hash = {}
  self.each_pair do |k,v|
    new_hash[k.to_sym] = value_or_symbolize_value(v)
  end
  new_hash
end