Exception: MonadOxide::EitherReturnExpectedError
- Inherits:
-
MonadOxideError
- Object
- StandardError
- MonadOxideError
- MonadOxide::EitherReturnExpectedError
- Defined in:
- lib/either.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) ⇒ EitherReturnExpectedError
constructor
The transformation expected a ‘Result’ but got something else.
Constructor Details
#initialize(data) ⇒ EitherReturnExpectedError
The transformation expected a ‘Result’ but got something else.
38 39 40 41 |
# File 'lib/either.rb', line 38 def initialize(data) super("An Either was expected but got #{data.inspect()}.") data = @data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
42 43 44 |
# File 'lib/either.rb', line 42 def data @data end |