module Synapse::EventSourcing::AggregateRoot::ClassMethods

Public Instance Methods

new_from_stream(stream) click to toggle source

Creates a new instance of this aggregate root without calling its initializer and initializes the state of the aggregate from the given event stream.

@param [DomainEventStream] stream @return [AggregateRoot]

# File lib/synapse/event_sourcing/aggregate_root.rb, line 115
def new_from_stream(stream)
  aggregate = allocate
  aggregate.initialize_from_stream stream
  aggregate
end