Class: ActiveSupport::Cache::IronCacheStore

Inherits:
Store
  • Object
show all
Defined in:
lib/active_support/cache/iron_cache_store.rb

Instance Method Summary collapse

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(options = nil)
  super(options)

  @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, options = nil)
  with_namespace(key, options) 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, options = nil)
  with_namespace(key, options) do |cache, k|
    cache.increment(k, amount)
  end
end