instance method
decrement
Ruby on Rails 3.0.20
Since v3.0.20Signature
decrement(name, amount = 1, options = nil)
Decrement an integer value in the cache.
Parameters
-
namereq -
amountopt = 1 -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache/memory_store.rb, line 90
def decrement(name, amount = 1, options = nil)
synchronize do
options = merged_options(options)
if num = read(name, options)
num = num.to_i - amount
write(name, num, options)
num
else
nil
end
end
end
Defined in activesupport/lib/active_support/cache/memory_store.rb line 90
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::MemoryStore