Files

Moqueue::ObjectMethods

Public Instance Methods

mock_exchange(opts={}) click to toggle source

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
mock_queue(name=nil) click to toggle source

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
mock_queue_and_exchange(name=nil) click to toggle source
   # 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
overload_amqp() click to toggle source

Overloads the class-level method calls typically used by AMQP code such as MQ.direct, MQ.queue, MQ.topic, etc.

    # File lib/moqueue/object_methods.rb, line 27
27:     def overload_amqp
28:       require MOQUEUE_ROOT + "moqueue/overloads"
29:     end
reset_broker() click to toggle source

Deletes all exchanges and queues from the mock broker. As a consequence of removing queues, all bindings and subscriptions are also deleted.

    # File lib/moqueue/object_methods.rb, line 33
33:     def reset_broker
34:       MockBroker.instance.reset!
35:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.