Class: RailsSimpleEventSourcing::EventApplicator
- Inherits:
-
Object
- Object
- RailsSimpleEventSourcing::EventApplicator
- Defined in:
- lib/rails_simple_event_sourcing/event_applicator.rb
Instance Method Summary collapse
- #apply_to_aggregate(aggregate) ⇒ Object
-
#initialize(event) ⇒ EventApplicator
constructor
A new instance of EventApplicator.
Constructor Details
#initialize(event) ⇒ EventApplicator
Returns a new instance of EventApplicator.
5 6 7 |
# File 'lib/rails_simple_event_sourcing/event_applicator.rb', line 5 def initialize(event) @event = event end |
Instance Method Details
#apply_to_aggregate(aggregate) ⇒ Object
9 10 11 12 13 |
# File 'lib/rails_simple_event_sourcing/event_applicator.rb', line 9 def apply_to_aggregate(aggregate) enable_aggregate_writes(aggregate) replay_history_if_needed(aggregate) apply_current_event(aggregate) end |