Method: IO#write_lines
- Defined in:
- lib/pleasant_path/io.rb
#write_lines(lines, eol: $/) ⇒ lines
Writes each object in lines
as a string plus eol
(end-of-line) characters to the IO. Returns lines
, unmodified.
18 19 20 21 22 23 24 25 |
# File 'lib/pleasant_path/io.rb', line 18 def write_lines(lines, eol: $/) lines.each do |line| self.write(line) self.write(eol) end self.write("") # write something even if no lines lines end |