Class: ActiveSupport::Cache::IronCacheStore
- Inherits:
-
Store
- Object
- Store
- ActiveSupport::Cache::IronCacheStore
- Defined in:
- lib/active_support/cache/iron_cache_store.rb
Instance Method Summary collapse
- #decrement(key, amount = 1, options = nil) ⇒ Object
- #increment(key, amount = 1, options = nil) ⇒ Object
-
#initialize(options = nil) ⇒ IronCacheStore
constructor
A new instance of IronCacheStore.
Constructor Details
#initialize(options = nil) ⇒ IronCacheStore
Returns a new instance of IronCacheStore.
8 9 10 11 12 13 14 |
# File 'lib/active_support/cache/iron_cache_store.rb', line 8 def initialize( = nil) super() @client = IronCache::Client.new(@options) extend ActiveSupport::Cache::Strategy::LocalCache end |
Instance Method Details
#decrement(key, amount = 1, options = nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/active_support/cache/iron_cache_store.rb', line 22 def decrement(key, amount = 1, = nil) with_namespace(key, ) do |cache, k| cache.increment(k, -amount) end end |
#increment(key, amount = 1, options = nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/active_support/cache/iron_cache_store.rb', line 16 def increment(key, amount = 1, = nil) with_namespace(key, ) do |cache, k| cache.increment(k, amount) end end |