Module: Euston::AggregateRoot::ClassMethods

Defined in:
lib/euston/aggregate_root.rb

Instance Method Summary collapse

Instance Method Details

#hydrate(stream, snapshot = nil, log = nil) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/euston/aggregate_root.rb', line 9

def hydrate stream, snapshot = nil, log = nil
  instance = self.new
  instance.log = log unless log.nil?
  instance.send :apply_snapshot, snapshot unless snapshot.nil?
  instance.send :apply_stream, stream
  instance
end