Class: Legion::Data::EventStore::GovernanceTimeline

Inherits:
Projection
  • Object
show all
Defined in:
lib/legion/data/event_store/projection.rb

Instance Attribute Summary

Attributes inherited from Projection

#state

Instance Method Summary collapse

Methods inherited from Projection

build_from

Constructor Details

#initializeGovernanceTimeline

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