Method: Redis#incr

Defined in:
lib/redis.rb

#incr(key) ⇒ Fixnum

Increment the integer value of a key by one.

Examples:

redis.incr("value")
  # => 6

Parameters:

  • key (String)

Returns:

  • (Fixnum)

    value after incrementing it



1680
1681
1682
1683
1684
# File 'lib/redis.rb', line 1680

def incr(key)
  synchronize do
    @client.call [:incr, key]
  end
end