Method: Redis#decr

Defined in:
lib/redis.rb

#decr(key) ⇒ Fixnum

Decrement the integer value of a key by one.

Examples:

redis.decr("value")
  # => 4

Parameters:

  • key (String)

Returns:

  • (Fixnum)

    value after decrementing it



582
583
584
585
586
# File 'lib/redis.rb', line 582

def decr(key)
  synchronize do |client|
    client.call([:decr, key])
  end
end