Sha256: 5b2ff168374ed3f0227e1172754097c073987d68fd81724a31b5e1b47c7503f9

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

class Brut::CLI::Output
  def initialize(io:, prefix:)
    @io          = io
    @prefix      = prefix
    @sync_status = @io.sync
  end

  def puts_no_prefix(*objects)
    @io.puts(*objects)
  end

  def puts(*objects)
    if objects.empty?
      objects << ""
    end
    objects.each do |object|
      @io.puts(@prefix + object.to_s)
    end
    nil
  end

  def print(*objects)
    @io.print(*objects)
  end

  def flush
    @io.flush
    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brut-0.0.1 lib/brut/cli/output.rb