Class: Jade::Err
- Inherits:
-
Data
- Object
- Data
- Jade::Err
- Defined in:
- lib/jade/result.rb
Instance Method Summary collapse
- #and_tap ⇒ Object
- #and_then ⇒ Object
- #and_then_combine ⇒ Object
- #error? ⇒ Boolean
- #map ⇒ Object
- #map2(_) ⇒ Object
- #map_error ⇒ Object (also: #map_both)
- #ok? ⇒ Boolean
- #on_err(error_type = nil) ⇒ Object
- #with_default(default) ⇒ Object
Instance Method Details
#and_tap ⇒ Object
90 91 92 |
# File 'lib/jade/result.rb', line 90 def and_tap self end |
#and_then ⇒ Object
77 78 79 |
# File 'lib/jade/result.rb', line 77 def and_then self end |
#and_then_combine ⇒ Object
94 95 96 |
# File 'lib/jade/result.rb', line 94 def and_then_combine self end |
#error? ⇒ Boolean
117 118 119 |
# File 'lib/jade/result.rb', line 117 def error? true end |
#map ⇒ Object
73 74 75 |
# File 'lib/jade/result.rb', line 73 def map self end |
#map2(_) ⇒ Object
86 87 88 |
# File 'lib/jade/result.rb', line 86 def map2(_) self end |
#map_error ⇒ Object Also known as: map_both
81 82 83 |
# File 'lib/jade/result.rb', line 81 def map_error Err.new(yield(err)) end |
#ok? ⇒ Boolean
113 114 115 |
# File 'lib/jade/result.rb', line 113 def ok? false end |
#on_err(error_type = nil) ⇒ Object
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/jade/result.rb', line 98 def on_err(error_type = nil) return yield(err) unless error_type case err when error_type yield(err) else self end end |
#with_default(default) ⇒ Object
109 110 111 |
# File 'lib/jade/result.rb', line 109 def with_default(default) default end |