Module: AMQP::Client::Settings

Defined in:
lib/jessica/amqp_client_connector.rb

Class Method Summary collapse

Class Method Details

.configure(settings = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/jessica/amqp_client_connector.rb', line 28

def self.configure(settings = nil)
  case settings
  when Hash then
    if user = settings.delete(:username)
      settings[:user] ||= user
    end
    if pass = settings.delete(:password)
      settings[:pass] ||= pass
    end
    self.default.merge(settings)
  when NilClass then
    self.default
  end
end

.defaultObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/jessica/amqp_client_connector.rb', line 17

def self.default
  @default ||= {
    :host  => "127.0.0.1", :port  => 5672,
    :user  => "guest", :pass  => "guest", :vhost => "/",
    # connection timeout
    :timeout => nil,
    :logging => false,
    :ssl => false
  }
end