Class: Umwelt::History::Aggregate

Inherits:
Abstract::Interactor show all
Defined in:
lib/umwelt/history/aggregate.rb

Instance Method Summary collapse

Methods inherited from Abstract::Interactor

#prove

Constructor Details

#initializeAggregate

Returns a new instance of Aggregate.



7
8
9
10
# File 'lib/umwelt/history/aggregate.rb', line 7

def initialize
  @engaged = {}
  @forgotten = []
end

Instance Method Details

#call(episodes) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/umwelt/history/aggregate.rb', line 12

def call(episodes)
  episodes.each do |episode|
    index_engaged(episode.engaged)
    collect_forgotten(episode.forgotten)
  end

  verify_consistency

  @fragments = @engaged.slice(*alive_ids).values
end