Class: Ragnar::Connector
- Inherits:
-
Object
- Object
- Ragnar::Connector
- Defined in:
- lib/ragnar/connector.rb
Class Attribute Summary collapse
-
.connection ⇒ Object
Store the connection for later retrieval.
-
.host ⇒ Object
Returns the value of attribute host.
-
.port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
-
.connect ⇒ Object
Pass connection options through to AMQP.
- .connected? ⇒ Boolean
Class Attribute Details
.connection ⇒ Object
Store the connection for later retrieval
10 11 12 |
# File 'lib/ragnar/connector.rb', line 10 def connection @connection end |
.host ⇒ Object
Returns the value of attribute host.
11 12 13 |
# File 'lib/ragnar/connector.rb', line 11 def host @host end |
.port ⇒ Object
Returns the value of attribute port.
12 13 14 |
# File 'lib/ragnar/connector.rb', line 12 def port @port end |
Class Method Details
.connect ⇒ Object
Pass connection options through to AMQP
15 16 17 18 19 20 |
# File 'lib/ragnar/connector.rb', line 15 def connect # backwards compatible code @host ||= ::Ragnar::Config.host @port ||= ::Ragnar::Config.port @connection = ::AMQP.connect({:host => @host, :port => @port}) end |
.connected? ⇒ Boolean
22 23 24 |
# File 'lib/ragnar/connector.rb', line 22 def connected? @connection && @connection.connected? end |