public Method

MemCache.decr(key, amount = 1)

Deceremets the value for key by amount and returns the new value. key must already exist. If key is not an integer, it is assumed to be

  1. key can not be decremented below 0.

Source Code

# File active_support/vendor/memcache-client-1.5.0/memcache.rb, line 214
def decr(key, amount = 1)
  server, cache_key = request_setup key

  if @multithread then
    threadsafe_cache_decr server, cache_key, amount
  else
    cache_decr server, cache_key, amount
  end
rescue TypeError, SocketError, SystemCallError, IOError => err
  handle_error server, err
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.