Method: Redis::Counter#value

Defined in:
lib/redis/counter.rb

#valueObject Also known as: get, to_i

Returns the current value of the counter. Normally just calling the counter will lazily fetch the value, and only update it if increment or decrement is called. This forces a network call to redis-server to get the current value.



34
35
36
# File 'lib/redis/counter.rb', line 34

def value
  redis.get(key).to_i
end