Class: BunnyBurrow::Base
- Inherits:
-
Object
- Object
- BunnyBurrow::Base
- Defined in:
- lib/bunny_burrow/base.rb
Instance Attribute Summary collapse
-
#log_prefix ⇒ Object
Returns the value of attribute log_prefix.
-
#log_request ⇒ Object
(also: #log_request?)
Returns the value of attribute log_request.
-
#log_response ⇒ Object
(also: #log_response?)
Returns the value of attribute log_response.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#rabbitmq_connection ⇒ Object
Returns the value of attribute rabbitmq_connection.
-
#rabbitmq_exchange ⇒ Object
Returns the value of attribute rabbitmq_exchange.
-
#rabbitmq_url ⇒ Object
Returns the value of attribute rabbitmq_url.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#verify_peer ⇒ Object
(also: #verify_peer?)
Returns the value of attribute verify_peer.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Base
constructor
A new instance of Base.
- #shutdown ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Base
Returns a new instance of Base.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bunny_burrow/base.rb', line 27 def initialize @log_request = false @log_response = false @timeout = 60 @verify_peer = true @own_connection = true yield self if block_given? @connection = @rabbitmq_connection @own_connection = @connection.nil? end |
Instance Attribute Details
#log_prefix ⇒ Object
Returns the value of attribute log_prefix.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def log_prefix @log_prefix end |
#log_request ⇒ Object Also known as: log_request?
Returns the value of attribute log_request.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def log_request @log_request end |
#log_response ⇒ Object Also known as: log_response?
Returns the value of attribute log_response.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def log_response @log_response end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def logger @logger end |
#rabbitmq_connection ⇒ Object
Returns the value of attribute rabbitmq_connection.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def rabbitmq_connection @rabbitmq_connection end |
#rabbitmq_exchange ⇒ Object
Returns the value of attribute rabbitmq_exchange.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def rabbitmq_exchange @rabbitmq_exchange end |
#rabbitmq_url ⇒ Object
Returns the value of attribute rabbitmq_url.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def rabbitmq_url @rabbitmq_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def timeout @timeout end |
#verify_peer ⇒ Object Also known as: verify_peer?
Returns the value of attribute verify_peer.
11 12 13 |
# File 'lib/bunny_burrow/base.rb', line 11 def verify_peer @verify_peer end |
Instance Method Details
#shutdown ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/bunny_burrow/base.rb', line 40 def shutdown return if @shutdown log 'Shutting down' channel.close connection.close if @own_connection @shutdown = true end |