Class: Stealth::RedisConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRedisConfig

Returns a new instance of RedisConfig.



10
11
12
13
14
# File 'lib/stealth/redis.rb', line 10

def initialize
  @url          = ENV["STEALTH_REDIS_URL"] || ENV["REDIS_URL"] || "redis://localhost:6379/0"
  @pool_size    = Integer(ENV["STEALTH_REDIS_POOL"] || 5)
  @pool_timeout = Integer(ENV["STEALTH_REDIS_TIMEOUT"] || 5)
end

Instance Attribute Details

#pool_sizeObject

Returns the value of attribute pool_size.



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

def pool_size
  @pool_size
end

#pool_timeoutObject

Returns the value of attribute pool_timeout.



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

def pool_timeout
  @pool_timeout
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#to_redis_kwargsObject



16
17
18
# File 'lib/stealth/redis.rb', line 16

def to_redis_kwargs
  { url: url }
end