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

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

Instance Method Summary collapse

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

#name

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

#name

Constructor Details

#initialize(raw_type, underlying_type) ⇒ GenericType

: (T::Module raw_type, T::Module underlying_type) -> void



30
31
32
33
34
# File 'lib/tapioca/runtime/generic_type_registry.rb', line 30

def initialize(raw_type, underlying_type)
  super(raw_type)

  @underlying_type = underlying_type #: T::Module[top]
end

Instance Method Details

#valid?(obj) ⇒ Boolean

: (untyped obj) -> bool

Returns:

  • (Boolean)


38
39
40
# File 'lib/tapioca/runtime/generic_type_registry.rb', line 38

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