Class: Cqrs::CommandExecutor
- Inherits:
-
Object
- Object
- Cqrs::CommandExecutor
- Defined in:
- lib/cqrs/command_executor.rb
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize ⇒ CommandExecutor
constructor
A new instance of CommandExecutor.
Constructor Details
#initialize ⇒ CommandExecutor
Returns a new instance of CommandExecutor.
3 4 5 6 7 |
# File 'lib/cqrs/command_executor.rb', line 3 def initialize @bus = CommandBus.new register_commands end |
Instance Method Details
#execute(command) ⇒ Object
9 10 11 |
# File 'lib/cqrs/command_executor.rb', line 9 def execute(command) @bus.(command) end |