Class: Counter::Cache::Redis
- Inherits:
-
Object
- Object
- Counter::Cache::Redis
- Defined in:
- lib/counter/cache/redis.rb
Instance Method Summary collapse
Instance Method Details
#decr(key, val = 1) ⇒ Object
10 11 12 13 14 |
# File 'lib/counter/cache/redis.rb', line 10 def decr(key, val = 1) with_redis do |redis| redis.decrby(key, val) end end |
#del(key) ⇒ Object
22 23 24 25 26 |
# File 'lib/counter/cache/redis.rb', line 22 def del(key) with_redis do |redis| redis.del(key) end end |
#get(key) ⇒ Object
16 17 18 19 20 |
# File 'lib/counter/cache/redis.rb', line 16 def get(key) with_redis do |redis| redis.get(key) end end |
#incr(key, val = 1) ⇒ Object
4 5 6 7 8 |
# File 'lib/counter/cache/redis.rb', line 4 def incr(key, val = 1) with_redis do |redis| redis.incrby key, val end end |