inspect()
public
Return a string describing this IO object.
Show source
static VALUE
rb_io_inspect(VALUE obj)
{
rb_io_t *fptr;
const char *cname;
const char *st = "";
fptr = RFILE(rb_io_taint_check(obj))->fptr;
if (!fptr || NIL_P(fptr->pathv)) return rb_any_to_s(obj);
cname = rb_obj_classname(obj);
if (fptr->fd < 0) {
st = " (closed)";
}
return rb_sprintf("#<%s:%s%s>", cname, RSTRING_PTR(fptr->pathv), st);
}