Class: Array

Inherits:
Object
  • Object
show all
Includes:
Hashable
Defined in:
lib/hashable/array.rb

Constant Summary

Constants included from Hashable

Hashable::VERSION

Instance Method Summary collapse

Instance Method Details

#to_deep_hashObject Also known as: to_dh

Return recursively hash representation of the given array

Returns:

  • array



8
9
10
11
12
13
14
# File 'lib/hashable/array.rb', line 8

def to_deep_hash
  new_array = []
  self.each_index do |index|
    new_array[index] = deeply_to_hash(self[index])
  end
  new_array
end