Method: Process::Status#inspect

Defined in:
process.c

#inspectString

Returns a string representation of self:

system("false")
$?.inspect # => "#<Process::Status: pid 1303494 exit 1>"

Returns:



835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
# File 'process.c', line 835

static VALUE
pst_inspect(VALUE st)
{
    rb_pid_t pid;
    int status;
    VALUE str;

    pid = pst_pid(st);
    if (!pid) {
        return rb_sprintf("#<%s: uninitialized>", rb_class2name(CLASS_OF(st)));
    }
    status = PST2INT(st);

    str = rb_sprintf("#<%s: ", rb_class2name(CLASS_OF(st)));
    pst_message(str, pid, status);
    rb_str_cat2(str, ">");
    return str;
}