Class: Synapse::EventSourcing::AggregateSnapshotTaker

Inherits:
SnapshotTaker
  • Object
show all
Defined in:
lib/synapse/event_sourcing/snapshot/aggregate_taker.rb

Overview

Snapshot taker that uses the actual aggregate and its state to create a snapshot event

Instance Attribute Summary

Attributes inherited from SnapshotTaker

#event_store, #executor

Instance Method Summary collapse

Methods inherited from SnapshotTaker

#schedule_snapshot

Constructor Details

#initializeundefined



6
7
8
9
# File 'lib/synapse/event_sourcing/snapshot/aggregate_taker.rb', line 6

def initialize
  super
  @aggregate_factories = Hash.new
end

Instance Method Details

#register_factory(factory) ⇒ undefined

Parameters:

Returns:

  • (undefined)


13
14
15
# File 'lib/synapse/event_sourcing/snapshot/aggregate_taker.rb', line 13

def register_factory(factory)
  @aggregate_factories.store factory.type_identifier, factory
end