Module: Redis::Store::Namespace
- Defined in:
- lib/redis/store/namespace.rb
Instance Method Summary collapse
- #decrby(key, increment) ⇒ Object
- #del(*keys) ⇒ Object
- #exists(key) ⇒ Object
- #get(key, options = nil) ⇒ Object
- #incrby(key, increment) ⇒ Object
- #keys(pattern = "*") ⇒ Object
- #mget(*keys) ⇒ Object
- #set(key, val, options = nil) ⇒ Object
- #setnx(key, val, options = nil) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#decrby(key, increment) ⇒ Object
24 25 26 |
# File 'lib/redis/store/namespace.rb', line 24 def decrby(key, increment) namespace(key) { |key| super(key, increment) } end |
#del(*keys) ⇒ Object
32 33 34 |
# File 'lib/redis/store/namespace.rb', line 32 def del(*keys) super *keys.map {|key| interpolate(key) } end |
#exists(key) ⇒ Object
16 17 18 |
# File 'lib/redis/store/namespace.rb', line 16 def exists(key) namespace(key) { |key| super(key) } end |
#get(key, options = nil) ⇒ Object
12 13 14 |
# File 'lib/redis/store/namespace.rb', line 12 def get(key, = nil) namespace(key) { |key| super(key, ) } end |
#incrby(key, increment) ⇒ Object
20 21 22 |
# File 'lib/redis/store/namespace.rb', line 20 def incrby(key, increment) namespace(key) { |key| super(key, increment) } end |
#keys(pattern = "*") ⇒ Object
28 29 30 |
# File 'lib/redis/store/namespace.rb', line 28 def keys(pattern = "*") namespace(pattern) { |pattern| super(pattern) } end |
#mget(*keys) ⇒ Object
36 37 38 |
# File 'lib/redis/store/namespace.rb', line 36 def mget(*keys) super *keys.map {|key| interpolate(key) } end |
#set(key, val, options = nil) ⇒ Object
4 5 6 |
# File 'lib/redis/store/namespace.rb', line 4 def set(key, val, = nil) namespace(key) { |key| super(key, val, ) } end |
#setnx(key, val, options = nil) ⇒ Object
8 9 10 |
# File 'lib/redis/store/namespace.rb', line 8 def setnx(key, val, = nil) namespace(key) { |key| super(key, val, ) } end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/redis/store/namespace.rb', line 40 def to_s "#{super} with namespace #{@namespace}" end |