Class: BottomlessHash

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

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#bottomless

Constructor Details

#initializeBottomlessHash

Returns a new instance of BottomlessHash.



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

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

Class Method Details

.from_hash(hash) ⇒ Object



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

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