Sha256: b44744f9894e202bcf0f83a7161f967a9b4758824c4f93649f182ee758ebfe44

Contents?: true

Size: 363 Bytes

Versions: 2

Compression:

Stored size: 363 Bytes

Contents

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

class Hash
  include Hashable

  # Return recursively hash representation of the given hash
  #
  # @return Base object instance variables in a Hash
  def to_deep_hash
    hash = {}
    self.keys.each do |key|
      hash[key] = deeply_to_hash(self[key])
    end
    hash
  end
  alias_method :to_dh, :to_deep_hash
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hashable-0.1.1 lib/hashable/hash.rb
hashable-0.1.0 lib/hashable/hash.rb