class

CrystalMonads::Try

Inherits Reference < Object

Class methods

try

Yields self. Nil overrides this method and doesn't yield.

This method is useful for dealing with nilable types, to safely perform operations only when the value is not nil.

# First program argument in downcase, or nil
ARGV[0]?.try &.downcase
Source
try(*args, &)
Source

Instance methods

failure?
Source
success?
Source

Nested types