Module: Redis::Store::Interface
- Included in:
- Redis::Store
- Defined in:
- lib/redis/store/interface.rb
Instance Method Summary collapse
- #get(key, options = nil) ⇒ Object
- #set(key, value, options = nil) ⇒ Object
- #setex(key, expiry, value, options = nil) ⇒ Object
- #setnx(key, value, options = nil) ⇒ Object
Instance Method Details
#get(key, options = nil) ⇒ Object
4 5 6 |
# File 'lib/redis/store/interface.rb', line 4 def get(key, = nil) super(key) end |
#set(key, value, options = nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/redis/store/interface.rb', line 11 def set(key, value, = nil) if && REDIS_SET_OPTIONS.any? { |k| .key?(k) } kwargs = REDIS_SET_OPTIONS.each_with_object({}) { |key, h| h[key] = [key] if .key?(key) } super(key, value, **kwargs) else super(key, value) end end |
#setex(key, expiry, value, options = nil) ⇒ Object
24 25 26 |
# File 'lib/redis/store/interface.rb', line 24 def setex(key, expiry, value, = nil) super(key, expiry, value) end |
#setnx(key, value, options = nil) ⇒ Object
20 21 22 |
# File 'lib/redis/store/interface.rb', line 20 def setnx(key, value, = nil) super(key, value) end |