Module: Legion::Extensions::Redis::Runners::Item
- Extended by:
- Helpers::Client
- Includes:
- Helpers::Lex
- Defined in:
- lib/legion/extensions/redis/runners/item.rb
Instance Method Summary collapse
- #decrement(key:, number: 1, **opts) ⇒ Object
- #delete(key:, **opts) ⇒ Object
- #exists(key:, **opts) ⇒ Object
- #get(key:, **opts) ⇒ Object
- #increment(key:, number: 1, **opts) ⇒ Object
- #keys(glob: '*', **opts) ⇒ Object
- #rename(old_key, key:, **opts) ⇒ Object
- #set(key:, value:, ttl: nil, **opts) ⇒ Object
Methods included from Helpers::Client
Instance Method Details
#decrement(key:, number: 1, **opts) ⇒ Object
12 13 14 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 12 def decrement(key:, number: 1, **opts) { result: client(**opts).decrby(key, number) } end |
#delete(key:, **opts) ⇒ Object
16 17 18 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 16 def delete(key:, **opts) { result: client(**opts).del(key) } end |
#exists(key:, **opts) ⇒ Object
20 21 22 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 20 def exists(key:, **opts) { result: client(**opts).exists?(key) } end |
#get(key:, **opts) ⇒ Object
8 9 10 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 8 def get(key:, **opts) { result: client(**opts).get(key) } end |
#increment(key:, number: 1, **opts) ⇒ Object
24 25 26 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 24 def increment(key:, number: 1, **opts) { result: client(**opts).incrby(key, number) } end |
#keys(glob: '*', **opts) ⇒ Object
28 29 30 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 28 def keys(glob: '*', **opts) { result: client(**opts).keys(glob) } end |
#rename(old_key, key:, **opts) ⇒ Object
32 33 34 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 32 def rename(old_key, key:, **opts) { result: client(**opts).rename(old_key, key) } end |
#set(key:, value:, ttl: nil, **opts) ⇒ Object
36 37 38 |
# File 'lib/legion/extensions/redis/runners/item.rb', line 36 def set(key:, value:, ttl: nil, **opts) { result: client(**opts).set(key, value, ex: ttl) } end |