Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/phocoder/extensions.rb

Instance Method Summary collapse

Instance Method Details

#recursive_with_indifferent_accessObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/phocoder/extensions.rb', line 3

def recursive_with_indifferent_access
  hash = with_indifferent_access

  hash.each do |key, value|
    if value.is_a?(Hash) || value.is_a?(Array)
      hash[key] = value.recursive_with_indifferent_access
    end
  end

  hash
end