Class: Legion::Data::EventStore::GovernanceTimeline
- Inherits:
-
Projection
- Object
- Projection
- Legion::Data::EventStore::GovernanceTimeline
- Defined in:
- lib/legion/data/event_store/projection.rb
Instance Attribute Summary
Attributes inherited from Projection
Instance Method Summary collapse
- #apply(event) ⇒ Object
-
#initialize ⇒ GovernanceTimeline
constructor
A new instance of GovernanceTimeline.
Methods inherited from Projection
Constructor Details
#initialize ⇒ GovernanceTimeline
Returns a new instance of GovernanceTimeline.
40 41 42 43 |
# File 'lib/legion/data/event_store/projection.rb', line 40 def initialize super @state = [] end |
Instance Method Details
#apply(event) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/legion/data/event_store/projection.rb', line 45 def apply(event) @state << { type: event[:type], stream: event[:stream], at: event[:created_at], data: event[:data] } end |