class Redis::Props::Objects::Hash
Attributes
key[R]
redis[R]
Public Class Methods
new(key, options = {})
click to toggle source
# File lib/redis/props/objects/hash.rb, line 7 def initialize(key, options = {}) @key = key @redis = Redis::Props.pools[options[:pool_name] || :default] end
Public Instance Methods
clear()
click to toggle source
Redis: DEL
# File lib/redis/props/objects/hash.rb, line 65 def clear redis.with { |conn| conn.del(key) } end
hdecrby(field, by = 1)
click to toggle source
Redis: HINCRBY
# File lib/redis/props/objects/hash.rb, line 44 def hdecrby(field, by = 1) hincrby(field, -by) end
Also aliased as: decr
hdel(*field)
click to toggle source
Redis: HDEL
# File lib/redis/props/objects/hash.rb, line 32 def hdel(*field) redis.with { |conn| conn.hdel(key, field) } end
Also aliased as: delete
hexists(field)
click to toggle source
Redis: HEXISTS
# File lib/redis/props/objects/hash.rb, line 50 def hexists(field) redis.with { |conn| conn.hexists(key, field) } end
hget(field)
click to toggle source
Redis: HGET
# File lib/redis/props/objects/hash.rb, line 19 def hget(field) redis.with { |conn| conn.hget(key, field) } end
hincrby(field, by = 1)
click to toggle source
Redis: HINCRBY
# File lib/redis/props/objects/hash.rb, line 38 def hincrby(field, by = 1) redis.with { |conn| conn.hincrby(key, field, by) } end
Also aliased as: incr
hkeys()
click to toggle source
Redis: HEXISTS
# File lib/redis/props/objects/hash.rb, line 59 def hkeys redis.with { |conn| conn.hkeys(key) } end
Also aliased as: keys
hmget(*field)
click to toggle source
Redis: HMGET
# File lib/redis/props/objects/hash.rb, line 26 def hmget(*field) redis.with { |conn| conn.hmget(key, field) } end
Also aliased as: mget
hset(field, value)
click to toggle source
Redis: HSET
# File lib/redis/props/objects/hash.rb, line 13 def hset(field, value) redis.with { |conn| conn.hset(key, field, value) } end
Also aliased as: []=