Class: UseCase::PreConditionFailed
Instance Method Summary
collapse
Methods inherited from Outcome
#failure, #result, #success, #success?
Constructor Details
Returns a new instance of PreConditionFailed.
56
57
58
59
|
# File 'lib/use_case/outcome.rb', line 56
def initialize(pre_condition = nil)
@pre_condition = pre_condition
@failure = PreConditionFailure.new(@pre_condition)
end
|
Instance Method Details
#pre_condition_failed {|@failure| ... } ⇒ Object
63
64
65
66
|
# File 'lib/use_case/outcome.rb', line 63
def pre_condition_failed
yield @failure if block_given?
@failure
end
|
#pre_condition_failed? ⇒ Boolean
61
|
# File 'lib/use_case/outcome.rb', line 61
def pre_condition_failed?; true; end
|
#to_s ⇒ Object
68
69
70
|
# File 'lib/use_case/outcome.rb', line 68
def to_s
"#<UseCase::PreConditionFailed: #{@pre_condition}>"
end
|