Class: Aggregates::CommandExecution
- Inherits:
-
Object
- Object
- Aggregates::CommandExecution
- Defined in:
- lib/aggregates/command_execution.rb
Overview
Captures the execution of a command with the aggregate at its current state.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #aggregate ⇒ Object
- #execute_with(handler) ⇒ Object
-
#initialize(aggregate_repo, command) ⇒ CommandExecution
constructor
A new instance of CommandExecution.
Constructor Details
#initialize(aggregate_repo, command) ⇒ CommandExecution
Returns a new instance of CommandExecution.
8 9 10 11 |
# File 'lib/aggregates/command_execution.rb', line 8 def initialize(aggregate_repo, command) @aggregate_repo = aggregate_repo @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/aggregates/command_execution.rb', line 6 def command @command end |
Instance Method Details
#aggregate ⇒ Object
17 18 19 |
# File 'lib/aggregates/command_execution.rb', line 17 def aggregate command.(@aggregate_repo) end |
#execute_with(handler) ⇒ Object
13 14 15 |
# File 'lib/aggregates/command_execution.rb', line 13 def execute_with(handler) handler.invoke_handlers(command, aggregate) end |