# File lib/amqp/client.rb, line 181 def self.connect(arg = nil) opts = case arg when String then opts = parse_connection_uri(arg) when Hash then arg else Hash.new end options = AMQP.settings.merge(opts) if options[:username] options[:user] = options.delete(:username) end if options[:password] options[:pass] = options.delete(:password) end EM.connect options[:host], options[:port], self, options end