Class: Emque::Producing::Configuration
- Inherits:
-
Object
- Object
- Emque::Producing::Configuration
- Defined in:
- lib/emque/producing/configuration.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#error_handlers ⇒ Object
Returns the value of attribute error_handlers.
-
#ignored_exceptions ⇒ Object
Returns the value of attribute ignored_exceptions.
-
#log_publish_message ⇒ Object
Returns the value of attribute log_publish_message.
-
#middleware ⇒ Object
readonly
Returns the value of attribute middleware.
-
#publish_messages ⇒ Object
Returns the value of attribute publish_messages.
-
#publishing_adapter ⇒ Object
Returns the value of attribute publishing_adapter.
-
#rabbitmq_options ⇒ Object
readonly
Returns the value of attribute rabbitmq_options.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #use(callable) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/emque/producing/configuration.rb', line 15 def initialize @app_name = "" @publishing_adapter = :rabbitmq @error_handlers = [] @log_publish_message = false @publish_messages = true @rabbitmq_options = { :url => "amqp://guest:guest@localhost:5672" } @ignored_exceptions = [Emque::Producing::Message::MessagesNotSentError] @middleware = [] end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
6 7 8 |
# File 'lib/emque/producing/configuration.rb', line 6 def app_name @app_name end |
#error_handlers ⇒ Object
Returns the value of attribute error_handlers.
8 9 10 |
# File 'lib/emque/producing/configuration.rb', line 8 def error_handlers @error_handlers end |
#ignored_exceptions ⇒ Object
Returns the value of attribute ignored_exceptions.
12 13 14 |
# File 'lib/emque/producing/configuration.rb', line 12 def ignored_exceptions @ignored_exceptions end |
#log_publish_message ⇒ Object
Returns the value of attribute log_publish_message.
9 10 11 |
# File 'lib/emque/producing/configuration.rb', line 9 def @log_publish_message end |
#middleware ⇒ Object (readonly)
Returns the value of attribute middleware.
13 14 15 |
# File 'lib/emque/producing/configuration.rb', line 13 def middleware @middleware end |
#publish_messages ⇒ Object
Returns the value of attribute publish_messages.
10 11 12 |
# File 'lib/emque/producing/configuration.rb', line 10 def @publish_messages end |
#publishing_adapter ⇒ Object
Returns the value of attribute publishing_adapter.
7 8 9 |
# File 'lib/emque/producing/configuration.rb', line 7 def publishing_adapter @publishing_adapter end |
#rabbitmq_options ⇒ Object (readonly)
Returns the value of attribute rabbitmq_options.
11 12 13 |
# File 'lib/emque/producing/configuration.rb', line 11 def @rabbitmq_options end |
Instance Method Details
#use(callable) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/emque/producing/configuration.rb', line 28 def use(callable) unless callable.respond_to?(:call) and callable.arity == 1 raise( ConfigurationError, "#{self.class.name}#use must receive a callable object with an " + "arity of one." ) end @middleware << callable end |