Sha256: dfd530d54fc34a3d2c08765ed7347ebb4729545ca64ee7624b7eda2f9311c680
Contents?: true
Size: 1004 Bytes
Versions: 4
Compression:
Stored size: 1004 Bytes
Contents
require 'redis' module SlackBotManager module Storage class Redis attr_accessor :connection def initialize(options) @connection = options.is_a?(Redis) ? options : ::Redis.new(options) end def pipeline(&block) connection.pipelined do yield block end end def get_all(type) connection.hgetall(type) end def get(type, key) connection.get(type, key) end def set(type, key, val) connection.hset(type, key, val) end def multiset(type, *args) connection.hmset(type, *args) end def delete(type, key) connection.hdel(type, key) end def delete_all(type) connection.del(type) end # def expire(key, len) # connection.expire(key, len) # end # def exists(type) # connection.exists(key) # end # def incrby(type, key, incr=1) # # TODO # end end end end
Version data entries
4 entries across 4 versions & 1 rubygems