Module: Typed::Undefined

Extended by:
Builder::BaseType
Defined in:
lib/typed.rb

Overview

Undefined is both:

  • A placeholder used to represent an undefined value.

  • The type used to represent this placeholder.

Class Method Summary collapse

Methods included from Builder::BaseType

call, constrained, constructor, default, enum, instance, missable, nullable, process, |

Class Method Details

.process(value) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/typed.rb', line 42

def process(value)
    if Undefined.equal?(value)
        Typed::Builder::Result.success(value)
    else
        Typed::Builder::Result.failure { 'Expected value undefined' }
    end
end