Module: StormMQ::AMQPClient
- Defined in:
- lib/stormmq/amqp.rb
Class Method Summary collapse
- .add_stormmq_options(options = {}) ⇒ Object
- .instance(options = {}) ⇒ Object
- .run(options = {}, &block) ⇒ Object
- .vhost_from_options(options) ⇒ Object
Class Method Details
.add_stormmq_options(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/stormmq/amqp.rb', line 25 def self.(={}) { :vhost => self.(), :host => 'amqp.stormmq.com', :port => 443, :ssl => true }.merge() end |
.instance(options = {}) ⇒ Object
17 18 19 |
# File 'lib/stormmq/amqp.rb', line 17 def self.instance(={}) Bunny.new(self.()) end |
.run(options = {}, &block) ⇒ Object
21 22 23 |
# File 'lib/stormmq/amqp.rb', line 21 def self.run(={}, &block) Bunny.run(self.(), &block) end |
.vhost_from_options(options) ⇒ Object
34 35 36 37 38 |
# File 'lib/stormmq/amqp.rb', line 34 def self.() vhost = "/#{[:company]}/#{[:system]}/#{[:environment]}" [:company, :system, :environment].each {|option| .delete(option)} vhost end |