123456789_123456789_123456789_123456789_123456789_

Class: ObjectSpace::InternalObjectWrapper

Relationships & Source Files
Inherits: Object
Defined in: ext/objspace/objspace.c

Overview

This class is used as a return value from reachable_objects_from.

When reachable_objects_from returns an object with references to an internal object, an instance of this class is returned.

You can use the #type method to check the type of the internal object.

Instance Method Summary

Instance Method Details

#inspect

See Object#inspect.

[ GitHub ]

  
# File 'ext/objspace/objspace.c', line 692

static VALUE
iow_inspect(VALUE self)
{
    VALUE obj = (VALUE)DATA_PTR(self);
    VALUE type = type2sym(BUILTIN_TYPE(obj));

    return rb_sprintf("#<InternalObject:%p %"PRIsVALUE">", (void *)obj, rb_sym2str(type));
}

#internal_object_id

Returns the Object#object_id of the internal object.

[ GitHub ]

  
# File 'ext/objspace/objspace.c', line 702

static VALUE
iow_internal_object_id(VALUE self)
{
    VALUE obj = (VALUE)DATA_PTR(self);
    return rb_obj_id(obj);
}

#type

Returns the type of the internal object.

[ GitHub ]

  
# File 'ext/objspace/objspace.c', line 684

static VALUE
iow_type(VALUE self)
{
    VALUE obj = (VALUE)DATA_PTR(self);
    return type2sym(BUILTIN_TYPE(obj));
}