method
increment
v7.1.3.2 -
Show latest stable
- Class:
ActiveSupport::Cache::MemoryStore
increment(name, amount = 1, options = nil)public
Increment a cached integer value. Returns the updated value.
If the key is unset, it will be set to amount:
cache.increment("foo") # => 1 cache.increment("bar", 100) # => 100
To set a specific value, call #write:
cache.write("baz", 5) cache.increment("baz") # => 6