Class: Lepus::Producers::Config
- Inherits:
-
Object
- Object
- Lepus::Producers::Config
- Extended by:
- Forwardable
- Defined in:
- lib/lepus/producers/config.rb
Overview
Configuration class for producer settings
Constant Summary collapse
- DEFAULT_POOL_SIZE =
1- DEFAULT_POOL_TIMEOUT =
5.0
Instance Attribute Summary collapse
-
#pool_size ⇒ Object
Returns the value of attribute pool_size.
-
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
Instance Method Summary collapse
-
#assign(options = {}) ⇒ void
Assign multiple attributes at once from a hash of options.
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
18 19 20 21 |
# File 'lib/lepus/producers/config.rb', line 18 def initialize @pool_size = DEFAULT_POOL_SIZE @pool_timeout = DEFAULT_POOL_TIMEOUT end |
Instance Attribute Details
#pool_size ⇒ Object
Returns the value of attribute pool_size.
14 15 16 |
# File 'lib/lepus/producers/config.rb', line 14 def pool_size @pool_size end |
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
14 15 16 |
# File 'lib/lepus/producers/config.rb', line 14 def pool_timeout @pool_timeout end |
Instance Method Details
#assign(options = {}) ⇒ void
This method returns an undefined value.
Assign multiple attributes at once from a hash of options.
26 27 28 29 30 31 32 |
# File 'lib/lepus/producers/config.rb', line 26 def assign( = {}) .each do |key, value| raise ArgumentError, "Unknown attribute #{key}" unless respond_to?(:"#{key}=") public_send(:"#{key}=", value) end end |