class EdgycircleToolbox::CQRS::CommandResult

Attributes

command[R]
errors[R]
events[R]

Public Class Methods

new(command = nil) click to toggle source
# File lib/edgycircle_toolbox/cqrs/command_result.rb, line 6
def initialize(command = nil)
  @command = command
  @events = []
  @errors = []
end

Public Instance Methods

add_error(error) click to toggle source
# File lib/edgycircle_toolbox/cqrs/command_result.rb, line 12
def add_error(error)
  errors << error
  self
end
add_event(event) click to toggle source
# File lib/edgycircle_toolbox/cqrs/command_result.rb, line 17
def add_event(event)
  events << event
  self
end
failure?() click to toggle source
# File lib/edgycircle_toolbox/cqrs/command_result.rb, line 27
def failure?
  errors.size > 0
end
set_command(command) click to toggle source
# File lib/edgycircle_toolbox/cqrs/command_result.rb, line 22
def set_command(command)
  @command = command
  self
end