Class: Cistern::Data::Hash
- Inherits:
-
Object
- Object
- Cistern::Data::Hash
- Defined in:
- lib/cistern/data/hash.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #fetch(key, *args) ⇒ Object (also: #[])
-
#initialize(options = {}, &default) ⇒ Hash
constructor
A new instance of Hash.
- #store(key, *args) ⇒ Object (also: #[]=)
Constructor Details
Instance Method Details
#clear ⇒ Object
9 10 11 |
# File 'lib/cistern/data/hash.rb', line 9 def clear hash.clear end |
#fetch(key, *args) ⇒ Object Also known as: []
21 22 23 24 25 |
# File 'lib/cistern/data/hash.rb', line 21 def fetch(key, *args) assign_default(key) hash.fetch(key, *args) end |
#store(key, *args) ⇒ Object Also known as: []=
13 14 15 16 17 |
# File 'lib/cistern/data/hash.rb', line 13 def store(key, *args) assign_default(key) hash.store(key, *args) end |