End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
ObjectSpace.internal_super_of
ObjectSpace.internal_super_of(cls) → Class or Module
ext/objspace/objspace.c
View on GitHub ↗
static VALUE
objspace_internal_super_of(VALUE self, VALUE obj)
{
VALUE super;
if (rb_typeddata_is_kind_of(obj, &iow_data_type)) {
obj = (VALUE)DATA_PTR(obj);
}
switch (OBJ_BUILTIN_TYPE(obj)) {
case T_MODULE:
case T_CLASS:
case T_ICLASS:
super = RCLASS_SUPER(obj);
break;
default:
rb_raise(rb_eArgError, "class or module is expected");
}
return wrap_klass_iow(super);
}
obj can be an instance of InternalObjectWrapper.
Note that you should not use this method in your application.
See also
.internal_class_of
.memsize_of
._id2ref
.memsize_of_all
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0