Class: ActivePubsub::Connection
- Inherits:
-
Delegator
- Object
- Delegator
- ActivePubsub::Connection
- Defined in:
- lib/active_pubsub/connection.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
7 8 9 10 11 |
# File 'lib/active_pubsub/connection.rb', line 7 def initialize( = {}) @connection = ::Bunny.new(::ActivePubsub.config.try(:address) || ENV["RABBITMQ_URL"]) @connection.start @channel = connection.create_channel end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
5 6 7 |
# File 'lib/active_pubsub/connection.rb', line 5 def channel @channel end |
#connection ⇒ Object
Returns the value of attribute connection.
5 6 7 |
# File 'lib/active_pubsub/connection.rb', line 5 def connection @connection end |
Instance Method Details
#__getobj__ ⇒ Object
13 14 15 |
# File 'lib/active_pubsub/connection.rb', line 13 def __getobj__ @connection end |