Class: Mutant::Either Private
- Inherits:
-
Object
- Object
- Mutant::Either
- Includes:
- AbstractType, Adamantium::Flat, Functor
- Defined in:
- lib/mutant/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Maybe
Defined Under Namespace
Class Method Summary collapse
-
.wrap_error(error) ⇒ Either<Exception, Object>
private
Execute block and wrap error in left.
Class Method Details
.wrap_error(error) ⇒ Either<Exception, Object>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Execute block and wrap error in left
82 83 84 85 86 |
# File 'lib/mutant/base.rb', line 82 def self.wrap_error(error) Right.new(yield) rescue error => exception Left.new(exception) end |