Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
ObjectSpace::InternalObjectWrapper#type
type → symbol
ext/objspace/objspace.c
View on GitHub ↗
static VALUE
iow_type(VALUE self)
{
VALUE obj = (VALUE)DATA_PTR(self);
return type2sym(BUILTIN_TYPE(obj));
}
Returns the type of the wrapped internal object as a symbol.
For example, an included module is represented internally as a T_ICLASS object:
Example
require 'objspace' module M; end class A; include M; end iclass = ObjectSpace.internal_super_of(A) iclass.type # => :T_ICLASS
The exact set of returned symbols is implementation specific.