instance method
increment
Ruby on Rails 3.2.22.5
Since v3.0.20Signature
increment(name, amount = 1, options = nil)
No documentation comment.
Parameters
-
namereq -
amountopt = 1 -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache/file_store.rb, line 39
def increment(name, amount = 1, options = nil)
file_name = key_file_path(namespaced_key(name, options))
lock_file(file_name) 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/file_store.rb line 39
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::FileStore