Class: Lapine::Test::FakeExchange
- Inherits:
-
Object
- Object
- Lapine::Test::FakeExchange
- Defined in:
- lib/lapine/test/exchange.rb
Instance Attribute Summary collapse
-
#histories ⇒ Object
readonly
Returns the value of attribute histories.
Instance Method Summary collapse
- #bind(history) ⇒ Object
- #channel ⇒ Object
-
#initialize ⇒ FakeExchange
constructor
A new instance of FakeExchange.
- #publish(body, routing_key = nil) ⇒ Object
Constructor Details
#initialize ⇒ FakeExchange
Returns a new instance of FakeExchange.
18 19 20 |
# File 'lib/lapine/test/exchange.rb', line 18 def initialize @histories = [] end |
Instance Attribute Details
#histories ⇒ Object (readonly)
Returns the value of attribute histories.
16 17 18 |
# File 'lib/lapine/test/exchange.rb', line 16 def histories @histories end |
Instance Method Details
#bind(history) ⇒ Object
26 27 28 |
# File 'lib/lapine/test/exchange.rb', line 26 def bind(history) histories << history end |
#channel ⇒ Object
22 23 24 |
# File 'lib/lapine/test/exchange.rb', line 22 def channel @channel ||= FakeChannel.new end |
#publish(body, routing_key = nil) ⇒ Object
30 31 32 33 34 |
# File 'lib/lapine/test/exchange.rb', line 30 def publish(body, routing_key = nil) histories.each do |h| h.publish(body, routing_key) end end |