Class: HashEasy::BottomlessHash
- Defined in:
- lib/hash_easy/bottomless_hash.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ BottomlessHash
constructor
A new instance of BottomlessHash.
Methods inherited from Hash
Constructor Details
#initialize ⇒ BottomlessHash
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 |