Class: Replay::TestEventStream
- Inherits:
-
Object
- Object
- Replay::TestEventStream
- Includes:
- EventExaminer
- Defined in:
- lib/replay/test/test_event_stream.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
Instance Method Summary collapse
-
#initialize ⇒ TestEventStream
constructor
A new instance of TestEventStream.
- #published(event_envelope) ⇒ Object
- #published?(stream_id, event) ⇒ Boolean
- #published_event?(event) ⇒ Boolean
Methods included from EventExaminer
#apply, #has_subscriber?, #similar_events
Constructor Details
#initialize ⇒ TestEventStream
Returns a new instance of TestEventStream.
7 8 9 |
# File 'lib/replay/test/test_event_stream.rb', line 7 def initialize @events = [] end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
5 6 7 |
# File 'lib/replay/test/test_event_stream.rb', line 5 def events @events end |
Instance Method Details
#published(event_envelope) ⇒ Object
10 11 12 |
# File 'lib/replay/test/test_event_stream.rb', line 10 def published(event_envelope) @events << event_envelope end |
#published?(stream_id, event) ⇒ Boolean
18 19 20 |
# File 'lib/replay/test/test_event_stream.rb', line 18 def published?(stream_id, event) @events.detect{|e| e.stream_id == stream_id && e.event == event} end |
#published_event?(event) ⇒ Boolean
14 15 16 |
# File 'lib/replay/test/test_event_stream.rb', line 14 def published_event?(event) @events.detect{|e| e.event==event} end |