module RedisRds

Constants

VERSION

Public Class Methods

config() click to toggle source
# File lib/redis_rds/config.rb, line 33
def self.config
  @config
end
configure(opts = {}) click to toggle source

Configure through hash

# File lib/redis_rds/config.rb, line 20
def self.configure(opts = {})
  opts.each { |k, v| @config[k.to_sym] = v if @valid_config_keys.include? k.to_sym }

  if opts[:connection].present?
    connection = opts[:connection]
  else
    config[:db] = config[:db].to_i
    connection = Redis.new(config)
  end

  RedisRds::Object.configure(connection: connection, namespace: opts[:namespace])
end