Class: Cqrs::CommandExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/cqrs/command_executor.rb

Instance Method Summary collapse

Constructor Details

#initializeCommandExecutor

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