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.5.0'
Class Method Summary collapse
Class Method Details
.connect(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/hot_bunnies.rb', line 15 def self.connect(={}) cf = ConnectionFactory.new cf.uri = [:uri] if [:uri] cf.host = hostname_from() if include_host?() cf.port = [:port] if [:port] cf.virtual_host = vhost_from() if include_vhost?() cf.connection_timeout = timeout_from() if include_timeout?() cf.username = username_from() if include_username?() cf.password = password_from() if include_password?() cf.requested_heartbeat = heartbeat_from() if include_heartbeat?() cf.connection_timeout = connection_timeout_from() if include_connection_timeout?() tls = ([:ssl] || [:tls]) case tls when true then cf.use_ssl_protocol when String then if [:trust_manager] cf.use_ssl_protocol(tls, [:trust_manager]) else cf.use_ssl_protocol(tls) end end cf.new_connection end |