Sha256: 16593f55039a3624f0be67aec457100d71bcb3e8ec44f763d2d03eae1bba39f7

Contents?: true

Size: 300 Bytes

Versions: 3

Compression:

Stored size: 300 Bytes

Contents

require "redis"

module Kredis::Connections
  mattr_accessor :connections, default: Hash.new
  mattr_accessor :configurator

  def configured_for(name)
    connections[name] ||= Redis.new configurator.config_for("redis/#{name}")
  end

  def clear_all
    connections.each_value(&:flushdb)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kredis-0.1.2 lib/kredis/connections.rb
kredis-0.1.1 lib/kredis/connections.rb
kredis-0.1.0 lib/kredis/connections.rb