quran-json/binlib/io/line.rb
2022-07-15 14:25:14 -03:00

24 lines
333 B
Ruby

# frozen_string_literal: true
class IO::Line
def initialize(io)
@io = io
@size = 0
end
def print(*strs)
tap do
str = strs.join
@size = str.gsub(/\n*/, "").size
@io.print(str)
end
end
def end
tap { @io.print "\n" }
end
def rewind
tap { @io.print "\b \b" * @size }
end
end