Class: UseCase::FailedOutcome
- Defined in:
- lib/use_case/outcome.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
- #failure {|@errors| ... } ⇒ Object
-
#initialize(errors = nil) ⇒ FailedOutcome
constructor
A new instance of FailedOutcome.
- #to_s ⇒ Object
Methods inherited from Outcome
#pre_condition_failed, #pre_condition_failed?, #result, #success, #success?
Constructor Details
#initialize(errors = nil) ⇒ FailedOutcome
Returns a new instance of FailedOutcome.
101 102 103 |
# File 'lib/use_case/outcome.rb', line 101 def initialize(errors = nil) @errors = errors end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
99 100 101 |
# File 'lib/use_case/outcome.rb', line 99 def input @input end |
Instance Method Details
#failure {|@errors| ... } ⇒ Object
105 106 107 108 |
# File 'lib/use_case/outcome.rb', line 105 def failure yield @errors if block_given? @errors end |
#to_s ⇒ Object
110 111 112 |
# File 'lib/use_case/outcome.rb', line 110 def to_s "#<UseCase::FailedOutcome: #{@errors}>" end |