Takes a hash to specify the exchange type and its name.
topic = mock_exchange(:topic => 'topic exchange')
# File lib/moqueue/object_methods.rb, line 21 21: def mock_exchange(opts={}) 22: MockExchange.new(opts) 23: end
Takes a string name as a parameter. Each queue name may only be used once. Multiple calls to # with the same name will return the same object.
# File lib/moqueue/object_methods.rb, line 14 14: def mock_queue(name=nil) 15: MockQueue.new(name || "anonymous-#{rand(2**32).to_s(16)}") 16: end
# File lib/moqueue/object_methods.rb, line 4 4: def mock_queue_and_exchange(name=nil) 5: queue = mock_queue(name) 6: exchange = mock_exchange 7: exchange.attached_queues << queue 8: [queue, exchange] 9: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.