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.
8 9 10 11 12 |
# File 'lib/active_pubsub/connection.rb', line 8 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.
6 7 8 |
# File 'lib/active_pubsub/connection.rb', line 6 def channel @channel end |
#connection ⇒ Object
Returns the value of attribute connection.
6 7 8 |
# File 'lib/active_pubsub/connection.rb', line 6 def connection @connection end |
Instance Method Details
#__getobj__ ⇒ Object
14 15 16 |
# File 'lib/active_pubsub/connection.rb', line 14 def __getobj__ @connection end |