Sha256: a39c8c00ee25b39ead05791e328fd38e21187b5b2469d455c139bca6c3a0ed46
Contents?: true
Size: 473 Bytes
Versions: 186
Compression:
Stored size: 473 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 aliased_type @aliased_type ||= T::Utils.coerce(@callable.call) end # @override Base def name aliased_type.name end # @override Base def valid?(obj) aliased_type.valid?(obj) end end end
Version data entries
186 entries across 186 versions & 1 rubygems