Class: Array

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

Instance Method Summary collapse

Instance Method Details

#recursive_with_indifferent_accessObject


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cloudhdr/extensions.rb', line 19

def recursive_with_indifferent_access
  array = dup

  array.each_with_index do |value, index|
    if value.is_a?(Hash) || value.is_a?(Array)
      array[index] = value.recursive_with_indifferent_access
    end
  end

  array
end