Class: ActiveSupport::Cache::Level2
- Inherits:
-
Store
- Object
- Store
- ActiveSupport::Cache::Level2
- Defined in:
- lib/active_support/cache/level2.rb
Instance Attribute Summary collapse
-
#stores ⇒ Object
readonly
Returns the value of attribute stores.
Instance Method Summary collapse
- #cleanup(*args) ⇒ Object
- #clear(*args) ⇒ Object
-
#initialize(store_options) ⇒ Level2
constructor
A new instance of Level2.
Constructor Details
#initialize(store_options) ⇒ Level2
Returns a new instance of Level2.
8 9 10 11 12 13 14 |
# File 'lib/active_support/cache/level2.rb', line 8 def initialize() @lock = Mutex.new @stores = .each_with_object({}) do |(name,), h| h[name] = ActiveSupport::Cache.lookup_store() end = {} end |
Instance Attribute Details
#stores ⇒ Object (readonly)
Returns the value of attribute stores.
6 7 8 |
# File 'lib/active_support/cache/level2.rb', line 6 def stores @stores end |
Instance Method Details
#cleanup(*args) ⇒ Object
16 17 18 19 20 |
# File 'lib/active_support/cache/level2.rb', line 16 def cleanup(*args) @lock.synchronize do @stores.each_value { |s| s.cleanup(*args) } end end |
#clear(*args) ⇒ Object
22 23 24 25 26 |
# File 'lib/active_support/cache/level2.rb', line 22 def clear(*args) @lock.synchronize do @stores.each_value { |s| s.clear(*args) } end end |