inspect()
public
Return a string describing this Dir object.
Show source
static VALUE
dir_inspect(VALUE dir)
{
struct dir_data *dirp;
TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
if (!NIL_P(dirp->path)) {
const char *c = rb_obj_classname(dir);
return rb_sprintf("#<%s:%s>", c, RSTRING_PTR(dirp->path));
}
return rb_funcall(dir, rb_intern("to_s"), 0, 0);
}