Exception: MonadOxide::ResultReturnExpectedError
- Inherits:
-
MonadOxideError
- Object
- StandardError
- MonadOxideError
- MonadOxide::ResultReturnExpectedError
- Defined in:
- lib/result.rb
Overview
This ‘Exception’ is produced when a method that expects the function or block to provide a ‘Result’ but was given something else. Generally this Exception is not raised, but instead converts the Result into a an Err. Example methods with this behavior are Result#and_then and Result#or_else.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ ResultReturnExpectedError
constructor
The transformation expected a ‘Result’ but got something else.
Constructor Details
#initialize(data) ⇒ ResultReturnExpectedError
The transformation expected a ‘Result’ but got something else.
23 24 25 26 |
# File 'lib/result.rb', line 23 def initialize(data) super("A Result was expected but got #{data.inspect}.") data = @data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
27 28 29 |
# File 'lib/result.rb', line 27 def data @data end |