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 ⇒ Object
readonly
Returns the value of attribute error.
Attributes inherited from Dry::Types::Result
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(input, error) ⇒ Failure
constructor
A new instance of Failure.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(input, error) ⇒ Failure
Returns a new instance of Failure.
29 30 31 32 |
# File 'lib/dry/types/result.rb', line 29 def initialize(input, error) super(input) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
27 28 29 |
# File 'lib/dry/types/result.rb', line 27 def error @error end |
Instance Method Details
#failure? ⇒ Boolean
42 43 44 |
# File 'lib/dry/types/result.rb', line 42 def failure? true end |
#success? ⇒ Boolean
38 39 40 |
# File 'lib/dry/types/result.rb', line 38 def success? false end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/dry/types/result.rb', line 34 def to_s error.to_s end |