Module: Cistern::Data::ClassMethods
- Defined in:
- lib/cistern/data.rb
Instance Method Summary collapse
- #clear! ⇒ Object
- #data ⇒ Object
- #reset! ⇒ Object
- #storage ⇒ Object
- #store_in(*args, **kwargs) ⇒ Object
Instance Method Details
#clear! ⇒ Object
29 30 31 |
# File 'lib/cistern/data.rb', line 29 def clear! data.clear end |
#data ⇒ Object
20 21 22 |
# File 'lib/cistern/data.rb', line 20 def data @data ||= Cistern::Data.backend(*storage) { |d, k| d[k] = [] } end |
#reset! ⇒ Object
24 25 26 27 |
# File 'lib/cistern/data.rb', line 24 def reset! clear! @data = nil end |
#storage ⇒ Object
38 39 40 |
# File 'lib/cistern/data.rb', line 38 def storage @storage ||= :hash end |
#store_in(*args, **kwargs) ⇒ Object
33 34 35 36 |
# File 'lib/cistern/data.rb', line 33 def store_in(*args, **kwargs) @storage = *args @data = nil end |