class ActiveSupport::Cache::MemoryStore
def decrement(name, amount = 1, options = nil)
cache.decrement("baz") # => 4
cache.write("baz", 5)
To set a specific value, call #write:
cache.decrement("foo") # => -1
If the key is unset or has expired, it will be set to +-amount+.
Decrement a cached integer value. Returns the updated value.
def decrement(name, amount = 1, options = nil) modify_value(name, -amount, options) end