display(p1 = v1)
public
Prints obj on the given port (default $>). Equivalent to:
def display(port=$>)
port.write self
nil
end
For example:
1.display
"cat".display
[ 4, 5, 6 ].display
puts
produces:
1cat[4, 5, 6]
Show source
static VALUE
rb_obj_display(int argc, VALUE *argv, VALUE self)
{
VALUE out;
if (argc == 0) {
out = rb_stdout;
}
else {
rb_scan_args(argc, argv, "01", &out);
}
rb_io_write(out, self);
return Qnil;
}