instance method
incr
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
incr(key, amount = 1)
Increments the value for key by amount and retruns the new value. key must already exist. If key is not an integer, it is assumed to be 0.
Parameters
-
keyreq -
amountopt = 1
Source
# File activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb, line 303
def incr(key, amount = 1)
server, cache_key = request_setup key
if @multithread then
threadsafe_cache_incr server, cache_key, amount
else
cache_incr server, cache_key, amount
end
rescue TypeError, SocketError, SystemCallError, IOError => err
handle_error server, err
end
Defined in activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb line 303
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in MemCache