Class: MultipleMan::Configuration
- Inherits:
-
Object
- Object
- MultipleMan::Configuration
- Defined in:
- lib/multiple_man/configuration.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#channel_pool_size ⇒ Object
Returns the value of attribute channel_pool_size.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#error_handler ⇒ Object
Returns the value of attribute error_handler.
- #logger ⇒ Object
-
#topic_name ⇒ Object
Returns the value of attribute topic_name.
-
#worker_concurrency ⇒ Object
Returns the value of attribute worker_concurrency.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #on_error(&block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 8 9 10 |
# File 'lib/multiple_man/configuration.rb', line 4 def initialize self.topic_name = "multiple_man" self.app_name = Rails.application.class.parent.to_s if defined?(Rails) self.enabled = true self.channel_pool_size = 5 self.worker_concurrency = 1 end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def app_name @app_name end |
#channel_pool_size ⇒ Object
Returns the value of attribute channel_pool_size.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def channel_pool_size @channel_pool_size end |
#connection ⇒ Object
Returns the value of attribute connection.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def connection @connection end |
#enabled ⇒ Object
Returns the value of attribute enabled.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def enabled @enabled end |
#error_handler ⇒ Object
Returns the value of attribute error_handler.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def error_handler @error_handler end |
#logger ⇒ Object
12 13 14 |
# File 'lib/multiple_man/configuration.rb', line 12 def logger @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT) end |
#topic_name ⇒ Object
Returns the value of attribute topic_name.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def topic_name @topic_name end |
#worker_concurrency ⇒ Object
Returns the value of attribute worker_concurrency.
20 21 22 |
# File 'lib/multiple_man/configuration.rb', line 20 def worker_concurrency @worker_concurrency end |
Instance Method Details
#on_error(&block) ⇒ Object
16 17 18 |
# File 'lib/multiple_man/configuration.rb', line 16 def on_error(&block) @error_handler = block end |