Class: Typed::Result
- Inherits:
-
Object
- Object
- Typed::Result
- Extended by:
- T::Generic, T::Helpers, T::Sig
- Defined in:
- lib/typed/result.rb
Overview
A monad representing either a success or a failure. Contains payload and error information as well.
Constant Summary collapse
- Payload =
type_member(:out)
- Error =
type_member(:out)
Instance Method Summary collapse
- #and_then(&_block) ⇒ Object
- #error ⇒ Object
- #failure? ⇒ Boolean
- #on_error(&block) ⇒ Object
- #payload ⇒ Object
- #payload_or(value) ⇒ Object
- #success? ⇒ Boolean
Instance Method Details
#and_then(&_block) ⇒ Object
44 45 |
# File 'lib/typed/result.rb', line 44 def and_then(&_block) end |
#error ⇒ Object
35 36 |
# File 'lib/typed/result.rb', line 35 def error end |
#failure? ⇒ Boolean
27 28 |
# File 'lib/typed/result.rb', line 27 def failure? end |
#on_error(&block) ⇒ Object
52 53 |
# File 'lib/typed/result.rb', line 52 def on_error(&block) end |
#payload ⇒ Object
31 32 |
# File 'lib/typed/result.rb', line 31 def payload end |
#payload_or(value) ⇒ Object
61 62 |
# File 'lib/typed/result.rb', line 61 def payload_or(value) end |
#success? ⇒ Boolean
23 24 |
# File 'lib/typed/result.rb', line 23 def success? end |