Module: Async::Redis::Methods::Keys
- Included in:
- Client, Context::Multi
- Defined in:
- lib/async/redis/methods/keys.rb
Instance Method Summary collapse
- #del(key, *keys) ⇒ Object
- #dump(key) ⇒ Object
- #exists(key, *keys) ⇒ Object
- #expire(key, seconds) ⇒ Object
- #expireat(key, time) ⇒ Object
- #keys(pattern) ⇒ Object
- #migrate ⇒ Object
- #move(key, db) ⇒ Object
- #object ⇒ Object
- #persist(key) ⇒ Object
- #pexpire(key, milliseconds) ⇒ Object
- #pexpireat(key, time) ⇒ Object
- #pttl(key) ⇒ Object
- #randomkey ⇒ Object
- #rename(key, new_key) ⇒ Object
- #renamenx(key, new_key) ⇒ Object
- #restore(key, serialized_value, ttl = 0) ⇒ Object
- #scan ⇒ Object
- #sort ⇒ Object
- #touch(key, *keys) ⇒ Object
- #ttl(key) ⇒ Object
- #type(key) ⇒ Object
- #unlink(key) ⇒ Object
- #wait(newreplicas, timeout) ⇒ Object
Instance Method Details
#del(key, *keys) ⇒ Object
28 29 30 |
# File 'lib/async/redis/methods/keys.rb', line 28 def del(key, *keys) return call('DEL', key, *keys) end |
#dump(key) ⇒ Object
32 33 34 |
# File 'lib/async/redis/methods/keys.rb', line 32 def dump(key) return call('DUMP', key) end |
#exists(key, *keys) ⇒ Object
36 37 38 |
# File 'lib/async/redis/methods/keys.rb', line 36 def exists(key, *keys) return call('EXISTS', key, *keys) end |
#expire(key, seconds) ⇒ Object
40 41 42 |
# File 'lib/async/redis/methods/keys.rb', line 40 def expire(key, seconds) return call('EXPIRE', key, seconds) end |
#expireat(key, time) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/async/redis/methods/keys.rb', line 44 def expireat(key, time) case time when DateTime, Time, Date = time.strftime('%s').to_i else = time end return call('EXPIREAT', key, ) end |
#keys(pattern) ⇒ Object
55 56 57 |
# File 'lib/async/redis/methods/keys.rb', line 55 def keys(pattern) return call('KEYS', pattern) end |
#migrate ⇒ Object
59 60 61 |
# File 'lib/async/redis/methods/keys.rb', line 59 def migrate end |
#move(key, db) ⇒ Object
63 64 65 |
# File 'lib/async/redis/methods/keys.rb', line 63 def move(key, db) return call('MOVE', key, db) end |
#object ⇒ Object
67 68 69 |
# File 'lib/async/redis/methods/keys.rb', line 67 def object end |
#persist(key) ⇒ Object
71 72 73 |
# File 'lib/async/redis/methods/keys.rb', line 71 def persist(key) return call('PERSIST', key) end |
#pexpire(key, milliseconds) ⇒ Object
75 76 77 |
# File 'lib/async/redis/methods/keys.rb', line 75 def pexpire(key, milliseconds) return call('PEXPIRE', milliseconds) end |
#pexpireat(key, time) ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/async/redis/methods/keys.rb', line 79 def pexpireat(key, time) case time.class when DateTime, Time, Date = time.strftime('%Q').to_i else = time end return call('PEXPIREAT', key, ) end |
#pttl(key) ⇒ Object
90 91 92 |
# File 'lib/async/redis/methods/keys.rb', line 90 def pttl(key) return call('PTTL', key) end |
#randomkey ⇒ Object
94 95 96 |
# File 'lib/async/redis/methods/keys.rb', line 94 def randomkey return call('RANDOMKEY') end |
#rename(key, new_key) ⇒ Object
98 99 100 |
# File 'lib/async/redis/methods/keys.rb', line 98 def rename(key, new_key) return call('RENAME', key, new_key) end |
#renamenx(key, new_key) ⇒ Object
102 103 104 |
# File 'lib/async/redis/methods/keys.rb', line 102 def renamenx(key, new_key) return call('RENAMENX', key, new_key) end |
#restore(key, serialized_value, ttl = 0) ⇒ Object
106 107 108 |
# File 'lib/async/redis/methods/keys.rb', line 106 def restore(key, serialized_value, ttl=0) return call('RESTORE', key, ttl, serialized_value) end |
#scan ⇒ Object
134 135 136 |
# File 'lib/async/redis/methods/keys.rb', line 134 def scan end |
#sort ⇒ Object
110 111 112 |
# File 'lib/async/redis/methods/keys.rb', line 110 def sort end |
#touch(key, *keys) ⇒ Object
114 115 116 |
# File 'lib/async/redis/methods/keys.rb', line 114 def touch(key, *keys) return call('TOUCH', key, *keys) end |
#ttl(key) ⇒ Object
118 119 120 |
# File 'lib/async/redis/methods/keys.rb', line 118 def ttl(key) return call('TTL', key) end |
#type(key) ⇒ Object
122 123 124 |
# File 'lib/async/redis/methods/keys.rb', line 122 def type(key) return call('TYPE', key) end |
#unlink(key) ⇒ Object
126 127 128 |
# File 'lib/async/redis/methods/keys.rb', line 126 def unlink(key) return call('UNLINK', key) end |
#wait(newreplicas, timeout) ⇒ Object
130 131 132 |
# File 'lib/async/redis/methods/keys.rb', line 130 def wait(newreplicas, timeout) end |