Sha256: bf448b076d064763bc5dacfb292ff7dc56be0d015b3617b2ba3229d0ac82f5f2

Contents?: true

Size: 394 Bytes

Versions: 4

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

class IO::Line::Multiple
  def initialize(lines, cursor)
    @lines = lines
    @cursor = cursor
  end

  def print(*strs, lineno:)
    line = @lines[lineno]
    if lineno > @cursor
      line.io.cursor_down(lineno - @cursor)
    elsif lineno < @cursor
      line.io.cursor_up(lineno + @cursor)
    end
    @cursor = lineno
    line.rewind.print(*strs)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
quran-audio-0.5.1 bundle/io-line.rb/lib/io/line/multiple.rb
quran-audio-0.5.0 bundle/io-line.rb/lib/io/line/multiple.rb
quran-audio-0.4.2 bundle/io-line.rb/lib/io/line/multiple.rb
io-line.rb-0.1.0 lib/io/line/multiple.rb