Class: AggregateRoot::DefaultApplyStrategy

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

Instance Method Summary collapse

Instance Method Details

#call(aggregate, event) ⇒ Object



3
4
5
6
# File 'lib/aggregate_root/default_apply_strategy.rb', line 3

def call(aggregate, event)
  event_name_processed = event.class.to_s.underscore
  aggregate.method("apply_#{event_name_processed}".to_sym).call(event)
end