Class: EasyCommand::Failure

Inherits:
Result
  • Object
show all
Defined in:
lib/easy_command/result.rb

Instance Method Summary collapse

Methods inherited from Result

#initialize, #on_failure, #on_success, #result

Methods included from Result::ClassMethods

#[]

Methods included from Chainable

included, #then

Constructor Details

This class inherits a constructor from EasyCommand::Result

Instance Method Details

#errorsObject



46
47
48
49
50
51
# File 'lib/easy_command/result.rb', line 46

def errors
  @_errors ||=
    EasyCommand::Errors.new.tap do |errors|
      errors.add(:result, :failure)
    end
end

#failure?Boolean

Returns:

  • (Boolean)


39
# File 'lib/easy_command/result.rb', line 39

def failure?; true; end

#success?Boolean

Returns:

  • (Boolean)


38
# File 'lib/easy_command/result.rb', line 38

def success?; false; end

#with_errors(errors) ⇒ Object



41
42
43
44
# File 'lib/easy_command/result.rb', line 41

def with_errors(errors)
  @_errors = errors
  self
end