p(*args)
public
For each object, directly writes obj.inspect followed by
a newline to the program’s standard output.
S = Struct.new(:name, :state)
s = S['dave', 'TX']
p s
produces:
Show source
static VALUE
rb_f_p(int argc, VALUE *argv, VALUE self)
{
int i;
VALUE ret = Qnil;
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
if (argc == 1) {
ret = argv[0];
}
else if (argc > 1) {
ret = rb_ary_new4(argc, argv);
}
if (TYPE(rb_stdout) == T_FILE) {
rb_io_flush(rb_stdout);
}
return ret;
}