class ActiveCommand::CommandResult

Attributes

command[RW]
error[RW]

Public Class Methods

new(command) click to toggle source
# File lib/active_command/command_result.rb, line 6
def initialize(command)
  @command = command
end

Public Instance Methods

is_successful?()
Alias for: success?
on_error?(&block) click to toggle source
# File lib/active_command/command_result.rb, line 22
def on_error?(&block)
  if ! self.is_successful?
    block.call(self)
  end
  self
end
on_success?(&block) click to toggle source
# File lib/active_command/command_result.rb, line 15
def on_success?(&block)
  if self.is_successful?
    block.call(self)
  end
  self
end
success?() click to toggle source
# File lib/active_command/command_result.rb, line 10
def success?
  self.error.nil?
end
Also aliased as: is_successful?