lib/message_queue.rb
# Public: Connect to the message queue.
#
# It either reads options from a Hash or the path to the Yaml settings file.
# After connecting, it stores the connection instance locally.
#
# file_or_options - The Hash options or the String Yaml settings file
#                   Detail Hash options see the new_connection method.
#
# Returns the connection for the specified message queue.
# Raises a RuntimeError if an adapter can't be found.
Connect to the message queue.
It either reads options from a Hash or the path to the Yaml settings file.
After connecting, it stores the connection instance locally.

The Hash options or the String Yaml settings file
Detail Hash options see the new_connection method.

Returns the connection for the specified message queue.
Raises a RuntimeError if an adapter can't be found.
Connect to the message queue . It either reads options from a Hash or the path to the Yaml settings file . After connecting it stores the connection instance locally . The Hash options or the String Yaml settings file Detail Hash options see the new_connection method . Returns the connection for the specified message queue . Raises a RuntimeError if an adapter can ' t be found .
def connect(file_or_options = {})
    if file_or_options.is_a?(String)
      require "yaml"
      file_or_options = YAML.load_file(file_or_options).inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
    end
    @settings = file_or_options.to_hash
    @connection = new_connection(@settings)
    @connection.connect
  end
def connect ( file_or_options = { } ) if file_or_options . is_a? ( String ) require "yaml" file_or_options = YAML . load_file ( file_or_options ) . inject ( { } ) { | memo , ( k , v ) | memo [ k . to_sym ] = v ; memo } end @settings = file_or_options . to_hash @connection = new_connection ( @settings ) @connection . connect end
Public: Connect to the message queue.
Public : Connect to the message queue .
file_or_options
<not_specific>