Class: RedisRds::String
Instance Attribute Summary
Attributes inherited from Object
#redis_key
Instance Method Summary
collapse
Methods inherited from Object
configure, #connection, connection, #delete, #dump, #exists?, #expire, #expireat, flushdb, #initialize, #namespace, #persist, #pttl, #ttl, #type
Instance Method Details
#append(suffix) ⇒ Object
26
27
28
|
# File 'lib/redis_rds/string.rb', line 26
def append(suffix)
return connection.append(@redis_key, suffix)
end
|
46
47
48
|
# File 'lib/redis_rds/string.rb', line 46
def decr
return connection.decr(@redis_key)
end
|
#decrby(decrement) ⇒ Object
50
51
52
|
# File 'lib/redis_rds/string.rb', line 50
def decrby(decrement)
return connection.decrby(@redis_key, decrement)
end
|
3
4
5
|
# File 'lib/redis_rds/string.rb', line 3
def get
return connection.get(@redis_key)
end
|
30
31
32
|
# File 'lib/redis_rds/string.rb', line 30
def incr
return connection.incr(@redis_key)
end
|
#incrby(increment) ⇒ Object
34
35
36
|
# File 'lib/redis_rds/string.rb', line 34
def incrby(increment)
return connection.incrby(@redis_key, increment)
end
|
38
39
40
|
# File 'lib/redis_rds/string.rb', line 38
def length
return connection.strlen(@redis_key)
end
|
#set(value, expiry: nil, nx: nil, xx: nil) ⇒ Boolean
Lifted from npepine/restruct
13
14
15
16
17
18
19
20
|
# File 'lib/redis_rds/string.rb', line 13
def set(value, expiry: nil, nx: nil, xx: nil)
options = {}
options[:ex] = expiry.to_i unless expiry.nil?
options[:nx] = nx unless nx.nil?
options[:xx] = xx unless xx.nil?
connection.set(@redis_key, value, options)
end
|
#setex(value, expiry) ⇒ Object
22
23
24
|
# File 'lib/redis_rds/string.rb', line 22
def setex(value, expiry)
return connection.setex(@redis_key, expiry, value)
end
|
#setnx(value) ⇒ Object
42
43
44
|
# File 'lib/redis_rds/string.rb', line 42
def setnx(value)
return connection.setnx(@redis_key, value)
end
|