Module: EventSorcerer::Aggregate
- Defined in:
- lib/event_sorcerer/aggregate.rb
Overview
Public: Mixin to turn a plain class into an event-store backed aggreagte.
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Public: Returns the ID for the aggregate.
-
#local_version ⇒ Object
readonly
Public: Returns the version number of the aggregate in memory.
-
#persisted_version ⇒ Object
readonly
Public: Returns the version number of the aggregate in the database.
Class Method Summary collapse
Instance Attribute Details
#id ⇒ Object (readonly)
Public: Returns the ID for the aggregate.
5 6 7 |
# File 'lib/event_sorcerer/aggregate.rb', line 5 def id @id end |
#local_version ⇒ Object (readonly)
Public: Returns the version number of the aggregate in memory.
8 9 10 |
# File 'lib/event_sorcerer/aggregate.rb', line 8 def local_version @local_version end |
#persisted_version ⇒ Object (readonly)
Public: Returns the version number of the aggregate in the database.
11 12 13 |
# File 'lib/event_sorcerer/aggregate.rb', line 11 def persisted_version @persisted_version end |
Class Method Details
.included(base) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/event_sorcerer/aggregate.rb', line 13 def self.included(base) base.class.send :alias_method, :build, :new base.extend(ClassMethods) base.class.extend(Uber::Delegates) base.class.send :delegates, :EventSorcerer, :event_store, :unit_of_work end |