Class: Tackle::Consumer::Params
- Inherits:
-
Object
- Object
- Tackle::Consumer::Params
- Defined in:
- lib/tackle/consumer/params.rb
Instance Attribute Summary collapse
-
#amqp_url ⇒ Object
readonly
Returns the value of attribute amqp_url.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#exception_handler ⇒ Object
readonly
Returns the value of attribute exception_handler.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#manual_ack ⇒ Object
readonly
Returns the value of attribute manual_ack.
-
#retry_delay ⇒ Object
readonly
Returns the value of attribute retry_delay.
-
#retry_limit ⇒ Object
readonly
Returns the value of attribute retry_limit.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Params
constructor
A new instance of Params.
- #manual_ack? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ Params
Returns a new instance of Params.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tackle/consumer/params.rb', line 16 def initialize(params = {}) # required @amqp_url = params.fetch(:url) @exchange = params.fetch(:exchange) @routing_key = params.fetch(:routing_key) @service = params.fetch(:service) # optional @retry_limit = params[:retry_limit] || 8 @retry_delay = params[:retry_delay] || 30 @logger = params[:logger] || Logger.new(STDOUT) @manual_ack = params.fetch(:manual_ack, false) @exception_handler = params[:exception_handler] @connection = params.fetch(:connection, nil) end |
Instance Attribute Details
#amqp_url ⇒ Object (readonly)
Returns the value of attribute amqp_url.
5 6 7 |
# File 'lib/tackle/consumer/params.rb', line 5 def amqp_url @amqp_url end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
14 15 16 |
# File 'lib/tackle/consumer/params.rb', line 14 def connection @connection end |
#exception_handler ⇒ Object (readonly)
Returns the value of attribute exception_handler.
12 13 14 |
# File 'lib/tackle/consumer/params.rb', line 12 def exception_handler @exception_handler end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
6 7 8 |
# File 'lib/tackle/consumer/params.rb', line 6 def exchange @exchange end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
11 12 13 |
# File 'lib/tackle/consumer/params.rb', line 11 def logger @logger end |
#manual_ack ⇒ Object (readonly)
Returns the value of attribute manual_ack.
13 14 15 |
# File 'lib/tackle/consumer/params.rb', line 13 def manual_ack @manual_ack end |
#retry_delay ⇒ Object (readonly)
Returns the value of attribute retry_delay.
10 11 12 |
# File 'lib/tackle/consumer/params.rb', line 10 def retry_delay @retry_delay end |
#retry_limit ⇒ Object (readonly)
Returns the value of attribute retry_limit.
9 10 11 |
# File 'lib/tackle/consumer/params.rb', line 9 def retry_limit @retry_limit end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
7 8 9 |
# File 'lib/tackle/consumer/params.rb', line 7 def routing_key @routing_key end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
8 9 10 |
# File 'lib/tackle/consumer/params.rb', line 8 def service @service end |
Instance Method Details
#manual_ack? ⇒ Boolean
34 35 36 |
# File 'lib/tackle/consumer/params.rb', line 34 def manual_ack? @manual_ack == true end |