Class: HashEasy::BottomlessHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/hash_easy/bottomless_hash.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#bottomless

Constructor Details

#initializeBottomlessHash

Returns a new instance of BottomlessHash.



3
4
5
# File 'lib/hash_easy/bottomless_hash.rb', line 3

def initialize
  super &-> h, k { h[k] = self.class.new }
end

Class Method Details

.from_hash(hash) ⇒ Object



7
8
9
# File 'lib/hash_easy/bottomless_hash.rb', line 7

def self.from_hash(hash)
  new.merge(hash)
end