Class: Interactor::Contracts::Outcome
- Inherits:
-
Object
- Object
- Interactor::Contracts::Outcome
- Extended by:
- Forwardable
- Defined in:
- lib/interactor/contracts/outcome.rb
Overview
The outcome of a Terms enforcement.
Instance Method Summary collapse
-
#breaches ⇒ Array<Breach>
The list of breaches of the Terms.
-
#failure? ⇒ Boolean
Checks whether the the Terms enforcement was a failure.
-
#initialize(result) ⇒ Outcome
constructor
private
Instantiantes a new Outcome based on the results of a Terms enforcement.
-
#success? ⇒ Boolean
Checks whether the the terms enforcement was a success.
Constructor Details
#initialize(result) ⇒ Outcome
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiantes a new Outcome based on the results of a Terms enforcement
15 16 17 |
# File 'lib/interactor/contracts/outcome.rb', line 15 def initialize(result) @result = result end |
Instance Method Details
#breaches ⇒ Array<Breach>
The list of breaches of the Terms
48 49 50 51 52 |
# File 'lib/interactor/contracts/outcome.rb', line 48 def breaches BreachSet.new(result.(:full => true).map do |property, | Breach.new(property, ) end) end |
#failure? ⇒ Boolean
Checks whether the the Terms enforcement was a failure
67 68 69 |
# File 'lib/interactor/contracts/outcome.rb', line 67 def failure? !success? end |
#success? ⇒ Boolean
Checks whether the the terms enforcement was a success
33 |
# File 'lib/interactor/contracts/outcome.rb', line 33 def_delegator :@result, :success? |