Class: RailsSimpleEventSourcing::EventPlayer
- Inherits:
-
Object
- Object
- RailsSimpleEventSourcing::EventPlayer
- Defined in:
- lib/rails_simple_event_sourcing/event_player.rb
Instance Method Summary collapse
-
#initialize(aggregate) ⇒ EventPlayer
constructor
A new instance of EventPlayer.
- #replay_stream ⇒ Object
Constructor Details
#initialize(aggregate) ⇒ EventPlayer
Returns a new instance of EventPlayer.
5 6 7 |
# File 'lib/rails_simple_event_sourcing/event_player.rb', line 5 def initialize(aggregate) @aggregate = aggregate end |
Instance Method Details
#replay_stream ⇒ Object
9 10 11 12 |
# File 'lib/rails_simple_event_sourcing/event_player.rb', line 9 def replay_stream events = load_event_stream apply_events(events) end |