Class: Opted::Result::AbstractResult Abstract
- Inherits:
-
Object
- Object
- Opted::Result::AbstractResult
- Defined in:
- lib/opted/result/abstract_result.rb
Overview
Instance Method Summary collapse
- #and(other) ⇒ Ok, Err
- #and_then {|value| ... } ⇒ Ok, Err
-
#err? ⇒ Boolean
If
self
is Err. -
#map {|value| ... } ⇒ Ok, Err
Returns a result of the same type wrapping the result of applying the block to the original inner value, leaving errors untouched.
-
#map_err {|error| ... } ⇒ Ok, Err
Returns a result of the same type wrapping the result of applying the block to the original inner error, leaving values untouched.
- #match(&block) ⇒ Object
-
#ok? ⇒ Boolean
If
self
is Ok. - #or(other) ⇒ Ok, Err
- #or_else {|value| ... } ⇒ Ok, Err
-
#unwrap! ⇒ Object
Returns the inner value if Ok.
-
#unwrap_err! ⇒ Object
Returns the inner error if Err.
- #unwrap_or(other_value) ⇒ Object
Instance Method Details
#and(other) ⇒ Ok, Err
86 87 |
# File 'lib/opted/result/abstract_result.rb', line 86 def and(other) end |
#and_then {|value| ... } ⇒ Ok, Err
103 104 |
# File 'lib/opted/result/abstract_result.rb', line 103 def and_then(&block) end |
#err? ⇒ Boolean
If self
is Err
19 20 |
# File 'lib/opted/result/abstract_result.rb', line 19 def err? end |
#map {|value| ... } ⇒ Ok, Err
Returns a result of the same type wrapping the result of applying the block to the original inner value, leaving errors untouched
51 52 |
# File 'lib/opted/result/abstract_result.rb', line 51 def map(&block) end |
#map_err {|error| ... } ⇒ Ok, Err
Returns a result of the same type wrapping the result of applying the block to the original inner error, leaving values untouched
65 66 |
# File 'lib/opted/result/abstract_result.rb', line 65 def map_err(&block) end |
#match(&block) ⇒ Object
155 156 |
# File 'lib/opted/result/abstract_result.rb', line 155 def match(&block) end |
#ok? ⇒ Boolean
If self
is Ok
11 12 |
# File 'lib/opted/result/abstract_result.rb', line 11 def ok? end |
#or(other) ⇒ Ok, Err
116 117 |
# File 'lib/opted/result/abstract_result.rb', line 116 def or(other) end |
#or_else {|value| ... } ⇒ Ok, Err
133 134 |
# File 'lib/opted/result/abstract_result.rb', line 133 def or_else(&block) end |
#unwrap! ⇒ Object
Returns the inner value if Ok
28 29 |
# File 'lib/opted/result/abstract_result.rb', line 28 def unwrap! end |
#unwrap_err! ⇒ Object
Returns the inner error if Err
37 38 |
# File 'lib/opted/result/abstract_result.rb', line 37 def unwrap_err! end |