Module: Redis::Store::Marshalling
- Defined in:
- lib/redis/store/marshalling.rb
Instance Method Summary collapse
- #get(key, options = nil) ⇒ Object
- #mget(*keys) ⇒ Object
- #set(key, value, options = nil) ⇒ Object
- #setnx(key, value, options = nil) ⇒ Object
Instance Method Details
#get(key, options = nil) ⇒ Object
12 13 14 |
# File 'lib/redis/store/marshalling.rb', line 12 def get(key, = nil) _unmarshal super(key), end |
#mget(*keys) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/redis/store/marshalling.rb', line 16 def mget(*keys) = keys.flatten.pop if keys.flatten.last.is_a?(Hash) super(*keys).map do |result| _unmarshal result, end end |
#set(key, value, options = nil) ⇒ Object
4 5 6 |
# File 'lib/redis/store/marshalling.rb', line 4 def set(key, value, = nil) _marshal(value, ) { |value| super key, value, } end |
#setnx(key, value, options = nil) ⇒ Object
8 9 10 |
# File 'lib/redis/store/marshalling.rb', line 8 def setnx(key, value, = nil) _marshal(value, ) { |value| super key, value, } end |