End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#<<
ios << obj → ios
io.c
View on GitHub ↗
VALUE
rb_io_addstr(VALUE io, VALUE str)
{
rb_io_write(io, str);
return io;
}
String Output—Writes obj to ios. obj will be converted to a string using to_s.
Example
$stdout << "Hello " << "world!\n"
produces:
Example
Hello world!