Class: Typed::Option

Inherits:
Object
  • Object
show all
Extended by:
T::Generic, T::Helpers, T::Sig
Defined in:
lib/typed/option.rb

Overview

A monad representing either a success or a failure. Contains payload and error information as well.

Direct Known Subclasses

None, Some

Constant Summary collapse

Payload =
type_member(:out)

Instance Method Summary collapse

Instance Method Details

#none?Boolean

Returns:

  • (Boolean)


23
24
# File 'lib/typed/option.rb', line 23

def none?
end

#payloadObject



27
28
# File 'lib/typed/option.rb', line 27

def payload
end

#payload_or(value) ⇒ Object



36
37
# File 'lib/typed/option.rb', line 36

def payload_or(value)
end

#some?Boolean

Returns:

  • (Boolean)


19
20
# File 'lib/typed/option.rb', line 19

def some?
end