Class: Dry::Types::Result::Failure
- Inherits:
-
Dry::Types::Result
- Object
- Dry::Types::Result
- Dry::Types::Result::Failure
- Defined in:
- lib/dry/types/result.rb
Instance Attribute Summary collapse
- #error ⇒ #to_s readonly
Attributes inherited from Dry::Types::Result
Instance Method Summary collapse
- #failure? ⇒ true
-
#initialize(input, error) ⇒ Failure
constructor
A new instance of Failure.
- #success? ⇒ false
- #to_s ⇒ String
Constructor Details
#initialize(input, error) ⇒ Failure
Returns a new instance of Failure.
36 37 38 39 |
# File 'lib/dry/types/result.rb', line 36 def initialize(input, error) super(input) @error = error end |
Instance Attribute Details
Instance Method Details
#failure? ⇒ true
52 53 54 |
# File 'lib/dry/types/result.rb', line 52 def failure? true end |
#success? ⇒ false
47 48 49 |
# File 'lib/dry/types/result.rb', line 47 def success? false end |
#to_s ⇒ String
42 43 44 |
# File 'lib/dry/types/result.rb', line 42 def to_s error.to_s end |