Module: HotBunnies

Defined in:
lib/hot_bunnies.rb,
lib/hot_bunnies/queue.rb,
lib/hot_bunnies/channel.rb,
lib/hot_bunnies/version.rb,
lib/hot_bunnies/exchange.rb

Defined Under Namespace

Modules: Channel Classes: Exchange, Queue

Constant Summary collapse

VERSION =
'1.3.6'

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hot_bunnies.rb', line 17

def self.connect(options={})
  cf = ConnectionFactory.new

  cf.uri                = options[:uri]          if options[:uri]
  cf.host               = hostname_from(options) if include_host?(options)
  cf.port               = options[:port]         if options[:port]
  cf.virtual_host       = vhost_from(options)    if include_vhost?(options)
  cf.connection_timeout = timeout_from(options)  if include_timeout?(options)
  cf.username           = username_from(options) if include_username?(options)
  cf.password           = password_from(options) if include_password?(options)

  cf.requested_heartbeat = heartbeat_from(options)          if include_heartbeat?(options)
  cf.connection_timeout  = connection_timeout_from(options) if include_connection_timeout?(options)

  cf.new_connection
end