Sha256: bc4c421bc563a569736b965900152d58e5f1135ea48d48b730c6285d40285e0d

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

require File.dirname(__FILE__) + '/hashable'

class Array
  include Hashable
  # Return recursively hash representation of the given array
  #
  # @return array
  def to_deep_hash
    new_array = []
    self.each_index do |index|
      new_array[index] = deeply_to_hash(self[index])
    end
    new_array
  end
  alias_method :to_dh, :to_deep_hash
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hashable-0.1.2 lib/hashable/array.rb