Module: Redis::Store::Marshalling

Defined in:
lib/redis/store/marshalling.rb

Instance Method Summary collapse

Instance Method Details

#get(key, options = nil) ⇒ Object



12
13
14
# File 'lib/redis/store/marshalling.rb', line 12

def get(key, options = nil)
  _unmarshal super(key), options
end

#mget(*keys) ⇒ Object



16
17
18
19
20
21
# File 'lib/redis/store/marshalling.rb', line 16

def mget(*keys)
  options = keys.flatten.pop if keys.flatten.last.is_a?(Hash)
  super(*keys).map do |result|
    _unmarshal result, options
  end
end

#set(key, value, options = nil) ⇒ Object



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

def set(key, value, options = nil)
  _marshal(value, options) { |value| super key, value, options }
end

#setnx(key, value, options = nil) ⇒ Object



8
9
10
# File 'lib/redis/store/marshalling.rb', line 8

def setnx(key, value, options = nil)
  _marshal(value, options) { |value| super key, value, options }
end