Module: AggregateRoot::Constructor

Defined in:
lib/aggregate_root.rb

Instance Method Summary collapse

Instance Method Details

#newObject



36
37
38
39
40
41
# File 'lib/aggregate_root.rb', line 36

def new(*, **)
  super.tap do |instance|
    instance.instance_variable_set(:@version, -1)
    instance.instance_variable_set(:@unpublished_events, [])
  end
end