Class: MidwireCommon::BottomlessHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/midwire_common/hash.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBottomlessHash

Returns a new instance of BottomlessHash.



13
14
15
# File 'lib/midwire_common/hash.rb', line 13

def initialize
  super(&->(hash, key) { hash[key] = self.class.new })
end

Class Method Details

.from_hash(hash) ⇒ Object



9
10
11
# File 'lib/midwire_common/hash.rb', line 9

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