Module: Cistern::Data::ClassMethods
- Defined in:
- lib/cistern/data.rb
Instance Method Summary collapse
- #clear! ⇒ Object
- #data ⇒ Object
- #reset! ⇒ Object
- #storage ⇒ Object
- #store_in(storage, options) ⇒ Object
Instance Method Details
#clear! ⇒ Object
21 22 23 |
# File 'lib/cistern/data.rb', line 21 def clear! self.data.clear end |
#data ⇒ Object
12 13 14 |
# File 'lib/cistern/data.rb', line 12 def data @data ||= Cistern::Data.backends[storage].new( || {}) { |d,k| d[k] = [] } end |
#reset! ⇒ Object
16 17 18 19 |
# File 'lib/cistern/data.rb', line 16 def reset! clear! @data = nil end |
#storage ⇒ Object
31 32 33 |
# File 'lib/cistern/data.rb', line 31 def storage @storage ||= :hash end |
#store_in(storage, options) ⇒ Object
25 26 27 28 29 |
# File 'lib/cistern/data.rb', line 25 def store_in(storage, ) @storage = storage = @data = nil end |