Class: Tapioca::Runtime::GenericTypeRegistry::GenericType

Inherits:
T::Types::Simple show all
Extended by:
T::Sig
Defined in:
lib/tapioca/runtime/generic_type_registry.rb

Constant Summary

Constants included from T::Types::Simple::NamePatch

T::Types::Simple::NamePatch::NAME_METHOD

Instance Method Summary collapse

Methods included from T::Types::Simple::NamePatch

#name, #qualified_name_of

Methods included from T::Types::Simple::GenericPatch

#name

Constructor Details

#initialize(raw_type, underlying_type) ⇒ GenericType

: (Module raw_type, Module underlying_type) -> void



32
33
34
35
36
# File 'lib/tapioca/runtime/generic_type_registry.rb', line 32

def initialize(raw_type, underlying_type)
  super(raw_type)

  @underlying_type = underlying_type #: Module
end

Instance Method Details

#valid?(obj) ⇒ Boolean

: (untyped obj) -> bool

Returns:

  • (Boolean)


40
41
42
# File 'lib/tapioca/runtime/generic_type_registry.rb', line 40

def valid?(obj)
  obj.is_a?(@underlying_type)
end