Class: Layercake::Store
- Inherits:
-
ActiveSupport::Cache::Store
- Object
- ActiveSupport::Cache::Store
- Layercake::Store
- Defined in:
- lib/layercake/store.rb
Instance Attribute Summary collapse
-
#stores ⇒ Object
readonly
Returns the value of attribute stores.
Instance Method Summary collapse
- #cleanup(options = nil) ⇒ Object
- #clear(options = nil) ⇒ Object
- #decrement(name, amount = 1, options = nil) ⇒ Object
- #delete_matched(matcher, options = nil) ⇒ Object
- #increment(name, amount = 1, options = nil) ⇒ Object
-
#initialize(*args) ⇒ Store
constructor
A new instance of Store.
Constructor Details
#initialize(*args) ⇒ Store
Returns a new instance of Store.
6 7 8 9 10 11 12 13 |
# File 'lib/layercake/store.rb', line 6 def initialize(*args) super() @stores = [] args.each do |arg| initialize_store(arg) end end |
Instance Attribute Details
#stores ⇒ Object (readonly)
Returns the value of attribute stores.
4 5 6 |
# File 'lib/layercake/store.rb', line 4 def stores @stores end |
Instance Method Details
#cleanup(options = nil) ⇒ Object
20 21 22 |
# File 'lib/layercake/store.rb', line 20 def cleanup( = nil) @stores.each{|store| store.cleanup()} end |
#clear(options = nil) ⇒ Object
16 17 18 |
# File 'lib/layercake/store.rb', line 16 def clear( = nil) @stores.each{|store| store.clear() } end |
#decrement(name, amount = 1, options = nil) ⇒ Object
28 29 30 |
# File 'lib/layercake/store.rb', line 28 def decrement(name, amount = 1, = nil) @stores.map{|store| store.decrement(name, amount, )}.first end |
#delete_matched(matcher, options = nil) ⇒ Object
32 33 34 |
# File 'lib/layercake/store.rb', line 32 def delete_matched(matcher, = nil) @stores.each{|store| store.delete_matched(matcher, )} end |
#increment(name, amount = 1, options = nil) ⇒ Object
24 25 26 |
# File 'lib/layercake/store.rb', line 24 def increment(name, amount = 1, = nil) @stores.map{|store| store.increment(name, amount, )}.first end |