Class: BigRails::Redis::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/big_rails/redis/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redis_options) ⇒ Configuration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
# File 'lib/big_rails/redis/configuration.rb', line 10

def initialize(redis_options)
  @redis_options = redis_options
  @urls = Array(redis_options.delete(:url))
  @pool_options ||= {}.tap do |pool_options|
    pool_options[:size] = redis_options.delete(:pool_size) if redis_options[:pool_size]
    pool_options[:timeout] = redis_options.delete(:pool_timeout) if redis_options[:pool_timeout]
  end
end

Instance Attribute Details

#pool_optionsObject (readonly)

Returns the value of attribute pool_options.



7
8
9
# File 'lib/big_rails/redis/configuration.rb', line 7

def pool_options
  @pool_options
end

#redis_optionsObject (readonly)

Returns the value of attribute redis_options.



6
7
8
# File 'lib/big_rails/redis/configuration.rb', line 6

def redis_options
  @redis_options
end

#urlsObject (readonly)

Returns the value of attribute urls.



8
9
10
# File 'lib/big_rails/redis/configuration.rb', line 8

def urls
  @urls
end