Module: AggregateRoot::Base
- Defined in:
- lib/aggregate_root/base.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/aggregate_root/base.rb', line 5 def id @id end |
Instance Method Details
#apply(event) ⇒ Object
7 8 9 10 |
# File 'lib/aggregate_root/base.rb', line 7 def apply(event) apply_event(event) unpublished_events << event end |
#apply_old_event(event) ⇒ Object
12 13 14 |
# File 'lib/aggregate_root/base.rb', line 12 def apply_old_event(event) apply_event(event) end |
#unpublished_events ⇒ Object
16 17 18 |
# File 'lib/aggregate_root/base.rb', line 16 def unpublished_events @unpublished_events ||= [] end |