Module: Redis::Store::Ttl
- Included in:
- Redis::Store
- Defined in:
- lib/redis/store/ttl.rb
Instance Method Summary collapse
Instance Method Details
#set(key, value, options = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/redis/store/ttl.rb', line 4 def set(key, value, = nil) if ttl = expires_in() setex(key, ttl.to_i, value, :raw => true) else super(key, value, ) end end |
#setnx(key, value, options = nil) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/redis/store/ttl.rb', line 12 def setnx(key, value, = nil) if ttl = expires_in() setnx_with_expire(key, value, ttl.to_i, ) else super(key, value) end end |