Method: Redis#incrby

Defined in:
lib/redis.rb

#incrby(key, increment) ⇒ Integer

Increment the integer value of a key by the given integer number.

Examples:

redis.incrby("value", 5)
  # => 10

Parameters:

  • key (String)
  • increment (Integer)

Returns:

  • (Integer)

    value after incrementing it


804
805
806
807
808
# File 'lib/redis.rb', line 804

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