Class: Errgonomic::Result::Err
Overview
The Err variant.
Defined Under Namespace
Classes: Arbitrary
Constant Summary
Constants inherited from Any
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#err? ⇒ Boolean
Err is always err.
-
#initialize(value = Arbitrary) ⇒ Err
constructor
Err may be constructed without a value, if you want.
-
#inspect ⇒ Object
Render like Rust's Debug; a value-less Err renders bare.
-
#ok? ⇒ Boolean
Err is never ok.
Methods inherited from Any
#<=>, #==, #and, #and_then, #deconstruct, #eql?, #err_and?, #expect!, #hash, #map, #map_err, #method_missing, #ok_and?, #or, #or_else, #pretty_print, #respond_to_missing?, #result?, #tap_err, #tap_ok, #to_json, #to_s, #unwrap!, #unwrap_err!, #unwrap_or, #unwrap_or_else
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Errgonomic::Result::Any
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
436 437 438 |
# File 'lib/errgonomic/result.rb', line 436 def value @value end |
Instance Method Details
#err? ⇒ Boolean
Err is always err
451 452 453 |
# File 'lib/errgonomic/result.rb', line 451 def err? true end |
#inspect ⇒ Object
Render like Rust's Debug; a value-less Err renders bare.
468 469 470 471 472 |
# File 'lib/errgonomic/result.rb', line 468 def inspect return 'Err()' if value == Arbitrary "Err(#{value.inspect})" end |
#ok? ⇒ Boolean
Err is never ok
459 460 461 |
# File 'lib/errgonomic/result.rb', line 459 def ok? false end |