Class: AMQP::Integration::Rails

### Home Classes Methods

### In Files

- lib/amqp/integration/rails.rb

### Parent

Object

### Methods

- ::start

### Class/Module Index

Quicksearch

- AMQP
- AMQP::Broker
- AMQP::ChannelClosedError
- AMQP::Consumer
- AMQP::Error
- AMQP::Header
- AMQP::IncompatibleOptionsError
- AMQP::Integration
- AMQP::Integration::Rails
- AMQP::PossibleAuthenticationFailureError
- AMQP::Session
- AMQP::TCPConnectionFailed
- AMQP::Utilities
- AMQP::Utilities::EventLoopHelper
- AMQP::Utilities::ServerType

No matching classes.

# AMQP::Integration::Rails

### Public Class Methods

start(options_or_uri = {}, &block) click to toggle source

    # File lib/amqp/integration/rails.rb, line 7
    def self.start(options_or_uri = {}, &block)
      yaml     = YAML.load_file(File.join(::Rails.root, "config", "amqp.yml"))
      settings = yaml.fetch(::Rails.env, Hash.new).symbolize_keys

      arg      = if options_or_uri.is_a?(Hash)
                   settings.merge(options_or_uri)[:uri]
                 else
                   settings[:uri] || options_or_uri
                 end

      EventMachine.next_tick do
        AMQP.start(arg, &block)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.