method
puts
v2_5_5 -
Show latest stable
-
0 notes -
Class: ARGF
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6 (18)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
puts(*args)
public
Writes the given object(s) to ios. Writes a newline after any that do not already end with a newline sequence. Returns nil.
The stream must be opened for writing. If called with an array argument, writes each element on a new line. Each given object that isn’t a string or array will be converted by calling its to_s method. If called without arguments, outputs a single newline.
$stdout.puts("this", "is", ["a", "test"])
produces:
this is a test
Note that puts always uses newlines and is not affected by the output record separator ($\).