In Files

  • objspace/objspace.c

Parent

Class/Module Index [+]

Quicksearch

ObjectSpace::InternalObjectWrapper

This class is used as a return value from ObjectSpace.reachable_objects_from.

When ObjectSpace.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.

Public Instance Methods

inspect() click to toggle source

See Object#inspect.

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

    return rb_sprintf("#<InternalObject:%p %s>", (void *)obj, rb_id2name(SYM2ID(type)));
}
            
internal_object_id() click to toggle source

Returns the Object#object_id of the internal object.

 
               static VALUE
iow_internal_object_id(VALUE self)
{
    VALUE obj = (VALUE)DATA_PTR(self);
    return rb_obj_id(obj);
}
            
type() click to toggle source

Returns the type of the internal object.

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

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus