Module: Cqrs::Helpers

Defined in:
lib/cqrs/helpers.rb

Instance Method Summary collapse

Instance Method Details

#command_executorObject

Provide access to the CQRS executor



14
15
16
# File 'lib/cqrs/helpers.rb', line 14

def command_executor
  @command_executor ||= NexusCqrs::CommandExecutor.new
end

#execute(command) ⇒ Object

Executes a CQRS Command



4
5
6
# File 'lib/cqrs/helpers.rb', line 4

def execute(command)
  command_executor.execute(command)
end

#query(query) ⇒ Object

Executes a CQRS Query



9
10
11
# File 'lib/cqrs/helpers.rb', line 9

def query(query)
  command_executor.execute(query)
end