Class: AggregateRoot::DefaultApplyStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/aggregate_root/default_apply_strategy.rb

Instance Method Summary collapse

Constructor Details

#initialize(strict: true) ⇒ DefaultApplyStrategy

Returns a new instance of DefaultApplyStrategy.



8
9
10
# File 'lib/aggregate_root/default_apply_strategy.rb', line 8

def initialize(strict: true)
  @strict = strict
end

Instance Method Details

#call(aggregate, event) ⇒ Object



12
13
14
# File 'lib/aggregate_root/default_apply_strategy.rb', line 12

def call(aggregate, event)
  on_handler(aggregate, event.event_type)[event]
end