instance method
decrement
Ruby on Rails 2.3.18
Since v2.2.3Signature
decrement(key, amount = 1)
No documentation comment.
Parameters
-
keyreq -
amountopt = 1
Source
# File activesupport/lib/active_support/cache.rb, line 225
def decrement(key, amount = 1)
log("decrementing", key, amount)
if num = read(key)
write(key, num - amount)
else
nil
end
end
Defined in activesupport/lib/active_support/cache.rb line 225
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Store