Class: Moqueue::MockBroker
- Inherits:
-
Object
- Object
- Moqueue::MockBroker
- Includes:
- Singleton
- Defined in:
- lib/moqueue/mock_broker.rb
Instance Attribute Summary collapse
-
#registered_queues ⇒ Object
readonly
Returns the value of attribute registered_queues.
Instance Method Summary collapse
- #find_fanout_exchange(fanout_name) ⇒ Object
- #find_queue(name) ⇒ Object
- #find_topic_exchange(topic) ⇒ Object
-
#initialize ⇒ MockBroker
constructor
A new instance of MockBroker.
- #register_fanout_exchange(exchange) ⇒ Object
- #register_queue(queue) ⇒ Object
- #register_topic_exchange(exchange) ⇒ Object
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ MockBroker
Returns a new instance of MockBroker.
9 10 11 |
# File 'lib/moqueue/mock_broker.rb', line 9 def initialize reset! end |
Instance Attribute Details
#registered_queues ⇒ Object (readonly)
Returns the value of attribute registered_queues.
7 8 9 |
# File 'lib/moqueue/mock_broker.rb', line 7 def registered_queues @registered_queues end |
Instance Method Details
#find_fanout_exchange(fanout_name) ⇒ Object
39 40 41 |
# File 'lib/moqueue/mock_broker.rb', line 39 def find_fanout_exchange(fanout_name) @registered_fanout_exchanges[fanout_name] end |
#find_queue(name) ⇒ Object
19 20 21 |
# File 'lib/moqueue/mock_broker.rb', line 19 def find_queue(name) @registered_queues[name] end |
#find_topic_exchange(topic) ⇒ Object
31 32 33 |
# File 'lib/moqueue/mock_broker.rb', line 31 def find_topic_exchange(topic) @registered_topic_exchanges[topic] end |
#register_fanout_exchange(exchange) ⇒ Object
35 36 37 |
# File 'lib/moqueue/mock_broker.rb', line 35 def register_fanout_exchange(exchange) @registered_fanout_exchanges[exchange.fanout] = exchange end |
#register_queue(queue) ⇒ Object
23 24 25 |
# File 'lib/moqueue/mock_broker.rb', line 23 def register_queue(queue) @registered_queues[queue.name] = queue end |
#register_topic_exchange(exchange) ⇒ Object
27 28 29 |
# File 'lib/moqueue/mock_broker.rb', line 27 def register_topic_exchange(exchange) @registered_topic_exchanges[exchange.topic] = exchange end |
#reset! ⇒ Object
13 14 15 16 17 |
# File 'lib/moqueue/mock_broker.rb', line 13 def reset! @registered_queues = {} @registered_topic_exchanges = {} @registered_fanout_exchanges = {} end |