Method: Redis#incr

Defined in:
lib/redis.rb

#incr(key) ⇒ Integer

Increment the integer value of a key by one.

Examples:

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

Parameters:

  • key (String)

Returns:

  • (Integer)

    value after incrementing it



789
790
791
792
793
# File 'lib/redis.rb', line 789

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