Class: RailsSimpleEventSourcing::EventPlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_simple_event_sourcing/event_player.rb

Instance Method Summary collapse

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_streamObject



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