Class: Stealth::RedisConfig
- Inherits:
-
Object
- Object
- Stealth::RedisConfig
- Defined in:
- lib/stealth/redis.rb
Instance Attribute Summary collapse
-
#pool_size ⇒ Object
Returns the value of attribute pool_size.
-
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ RedisConfig
constructor
A new instance of RedisConfig.
- #to_redis_kwargs ⇒ Object
Constructor Details
#initialize ⇒ RedisConfig
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_size ⇒ Object
Returns the value of attribute pool_size.
8 9 10 |
# File 'lib/stealth/redis.rb', line 8 def pool_size @pool_size end |
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
8 9 10 |
# File 'lib/stealth/redis.rb', line 8 def pool_timeout @pool_timeout end |
#url ⇒ Object
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_kwargs ⇒ Object
16 17 18 |
# File 'lib/stealth/redis.rb', line 16 def to_redis_kwargs { url: url } end |