Sha256: 58b2a8657e2d1bf4939910a1e519c15abf1bde4ac09d5fb05ca070373d21d132
Contents?: true
Size: 498 Bytes
Versions: 14
Compression:
Stored size: 498 Bytes
Contents
class RedisConnection @@redis_connections = {} def initialize(options={}) key = options.keys.sort.map{|k| "#{k}:#{options[k]}"}.join(",") unless @@redis_connections.has_key?(key) @@redis_connections[key] = Redis.new(options) end @current_connection = @@redis_connections[key] @current_connection end def method_missing(m, *args, &block) if @current_connection.respond_to?(m) @current_connection.send(m, *args) else super end end end
Version data entries
14 entries across 14 versions & 1 rubygems