Class: Lapin::Config
- Inherits:
-
Object
- Object
- Lapin::Config
- Defined in:
- lib/lapin/config.rb
Class Attribute Summary collapse
-
.amqp_url ⇒ Object
Returns the value of attribute amqp_url.
-
.exchange ⇒ Object
Returns the value of attribute exchange.
-
.logging ⇒ Object
Returns the value of attribute logging.
-
.routing_key ⇒ Object
Returns the value of attribute routing_key.
-
.vhost ⇒ Object
Returns the value of attribute vhost.
Class Method Summary collapse
Class Attribute Details
.amqp_url ⇒ Object
Returns the value of attribute amqp_url.
8 9 10 |
# File 'lib/lapin/config.rb', line 8 def amqp_url @amqp_url end |
.exchange ⇒ Object
Returns the value of attribute exchange.
9 10 11 |
# File 'lib/lapin/config.rb', line 9 def exchange @exchange end |
.logging ⇒ Object
Returns the value of attribute logging.
10 11 12 |
# File 'lib/lapin/config.rb', line 10 def logging @logging end |
.routing_key ⇒ Object
Returns the value of attribute routing_key.
9 10 11 |
# File 'lib/lapin/config.rb', line 9 def routing_key @routing_key end |
.vhost ⇒ Object
Returns the value of attribute vhost.
8 9 10 |
# File 'lib/lapin/config.rb', line 8 def vhost @vhost end |
Class Method Details
.amqp_config ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lapin/config.rb', line 12 def amqp_config uri = URI.parse(amqp_url) { :user => uri.user, :pass => uri.password, :host => uri.host, :port => (uri.port || 5672), :vhost => @vhost || uri.path , :logging => @logging || false } rescue Object => e raise "Invalid AMQP url: #{uri.inspect} (#{e})" end |