Class: DynamicLinks::RedisConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamic_links/redis_config.rb

Overview

RedisConfig is a class to hold Redis configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}, pool_size = 5, pool_timeout = 5) ⇒ RedisConfig

Default to an empty hash, can be overridden

config = {
  host: 'localhost',
  port: 6379
}

Parameters:

  • config (Hash) (defaults to: {})
  • pool_size (Integer) (defaults to: 5)

    Default to 5, can be overridden

  • pool_timeout (Integer) (defaults to: 5)

    Default to 5, can be overridden



16
17
18
19
20
# File 'lib/dynamic_links/redis_config.rb', line 16

def initialize(config = {}, pool_size = 5, pool_timeout = 5)
  @config = config
  @pool_size = pool_size
  @pool_timeout = pool_timeout
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



6
7
8
# File 'lib/dynamic_links/redis_config.rb', line 6

def config
  @config
end

#pool_sizeObject

Returns the value of attribute pool_size.



6
7
8
# File 'lib/dynamic_links/redis_config.rb', line 6

def pool_size
  @pool_size
end

#pool_timeoutObject

Returns the value of attribute pool_timeout.



6
7
8
# File 'lib/dynamic_links/redis_config.rb', line 6

def pool_timeout
  @pool_timeout
end