Module: Redis::Store::Interface

Included in:
Redis::Store
Defined in:
lib/redis/store/interface.rb

Instance Method Summary collapse

Instance Method Details

#get(key, options = nil) ⇒ Object



4
5
6
# File 'lib/redis/store/interface.rb', line 4

def get(key, options = 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, options = nil)
  if options && REDIS_SET_OPTIONS.any? { |k| options.key?(k) }
    kwargs = REDIS_SET_OPTIONS.each_with_object({}) { |key, h| h[key] = options[key] if options.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, options = 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, options = nil)
  super(key, value)
end