Class: Dry::Types::Result::Failure
- Inherits:
-
Dry::Types::Result
- Object
- Dry::Types::Result
- Dry::Types::Result::Failure
- Defined in:
- lib/dry/types/result.rb
Overview
Failure result
Instance Attribute Summary collapse
- #error ⇒ #to_s readonly
Instance Method Summary collapse
- #failure? ⇒ true
-
#initialize(input, error) ⇒ Failure
constructor
private
A new instance of Failure.
- #success? ⇒ false
- #to_s ⇒ String private
Constructor Details
#initialize(input, error) ⇒ Failure
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.
Returns a new instance of Failure.
54 55 56 57 |
# File 'lib/dry/types/result.rb', line 54 def initialize(input, error) super(input) @error = error end |
Instance Attribute Details
Instance Method Details
#failure? ⇒ true
76 77 78 |
# File 'lib/dry/types/result.rb', line 76 def failure? true end |
#success? ⇒ false
69 70 71 |
# File 'lib/dry/types/result.rb', line 69 def success? false end |
#to_s ⇒ String
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.
62 63 64 |
# File 'lib/dry/types/result.rb', line 62 def to_s error.to_s end |