Sha256: 3940f04c22913f072aa4462a224ab6d7fb6274fd73713f0296f02f43174a46b0
Contents?: true
Size: 616 Bytes
Versions: 165
Compression:
Stored size: 616 Bytes
Contents
# frozen_string_literal: true # typed: true module T::Private::Types # Wraps a proc for a type alias to defer its evaluation. class TypeAlias < T::Types::Base def initialize(callable) @callable = callable end def build_type nil end def aliased_type @aliased_type ||= T::Utils.coerce(@callable.call) end # overrides Base def name aliased_type.name end # overrides Base def recursively_valid?(obj) aliased_type.recursively_valid?(obj) end # overrides Base def valid?(obj) aliased_type.valid?(obj) end end end
Version data entries
165 entries across 165 versions & 1 rubygems