Class: Umwelt::History::Aggregate
- Inherits:
-
Abstract::Interactor
- Object
- Abstract::Interactor
- Umwelt::History::Aggregate
- Defined in:
- lib/umwelt/history/aggregate.rb
Instance Method Summary collapse
- #call(episodes) ⇒ Object
-
#initialize ⇒ Aggregate
constructor
A new instance of Aggregate.
Methods inherited from Abstract::Interactor
Constructor Details
#initialize ⇒ Aggregate
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 |