Method: Bunny::Exchange#initialize
- Defined in:
- lib/bunny/exchange.rb
#initialize(channel, type, name, opts = {}) ⇒ Exchange
Returns a new instance of Exchange.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/bunny/exchange.rb', line 76 def initialize(channel, type, name, opts = {}) @channel = channel @name = name @type = type = self.class.(name, opts) @durable = [:durable] @auto_delete = [:auto_delete] @internal = [:internal] @arguments = [:arguments] @bindings = Set.new declare! unless opts[:no_declare] || predeclared? || (@name == AMQ::Protocol::EMPTY_STRING) @channel.register_exchange(self) end |