class Aggregates::CommandExecution

Captures the execution of a command with the aggregate at its current state.

Attributes

command[R]

Public Class Methods

new(aggregate_repo, command) click to toggle source
# File lib/aggregates/command_execution.rb, line 8
def initialize(aggregate_repo, command)
  @aggregate_repo = aggregate_repo
  @command = command
end

Public Instance Methods

aggregate() click to toggle source
# File lib/aggregates/command_execution.rb, line 17
def aggregate
  command.load_related_aggregate(@aggregate_repo)
end
execute_with(handler) click to toggle source
# File lib/aggregates/command_execution.rb, line 13
def execute_with(handler)
  handler.invoke_handlers(command, aggregate)
end