Class: AMQP::Integration::Rails
- Inherits:
-
Object
- Object
- AMQP::Integration::Rails
- Defined in:
- lib/amqp/integration/rails.rb
Class Method Summary collapse
Class Method Details
.start(options_or_uri = {}, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/amqp/integration/rails.rb', line 7 def self.start( = {}, &block) yaml = YAML.load_file(File.join(::Rails.root, "config", "amqp.yml")) settings = yaml.fetch(::Rails.env, Hash.new).symbolize_keys arg = if .is_a?(Hash) settings.merge()[:uri] else settings[:uri] || end EventMachine.next_tick do AMQP.start(arg, &block) end end |