Module: Try
- Includes:
- Contracts::Core, Trither::BasicTypes
- Defined in:
- lib/trither/try.rb
Defined Under Namespace
Constant Summary collapse
- TryType =
C::Or[Failure, Success]
- Func0toTry =
C::Func[C::None => TryType]
- Func1toTry =
C::Func[C::Any => TryType]
Constants included from Trither::BasicTypes
Trither::BasicTypes::C, Trither::BasicTypes::Func0, Trither::BasicTypes::Func1, Trither::BasicTypes::Predicate
Class Method Summary collapse
Class Method Details
.make ⇒ Object
18 19 20 21 22 |
# File 'lib/trither/try.rb', line 18 def self.make Success.new(yield) rescue StandardError => error Failure.new(error) end |