class TTY::Command::Printers::Abstract
Attributes
err_data[RW]
options[R]
out_data[RW]
output[R]
Public Class Methods
new(output, options = {})
click to toggle source
Initialize a Printer object
@param [IO] output
the printer output
@api public
# File lib/tty/command/printers/abstract.rb, line 22 def initialize(output, options = {}) @output = output @options = options @enabled = options.fetch(:color) { true } @color = ::Pastel.new(enabled: @enabled) @out_data = '' @err_data = '' end
Public Instance Methods
print_command_err_data(cmd, *args)
click to toggle source
# File lib/tty/command/printers/abstract.rb, line 40 def print_command_err_data(cmd, *args) write(args.join(' ')) end
print_command_exit(cmd, *args)
click to toggle source
# File lib/tty/command/printers/abstract.rb, line 44 def print_command_exit(cmd, *args) write(args.join(' ')) end
print_command_out_data(cmd, *args)
click to toggle source
# File lib/tty/command/printers/abstract.rb, line 36 def print_command_out_data(cmd, *args) write(args.join(' ')) end
print_command_start(cmd, *args)
click to toggle source
# File lib/tty/command/printers/abstract.rb, line 32 def print_command_start(cmd, *args) write(cmd.to_command + "#{args.join}") end
write(cmd, message)
click to toggle source
# File lib/tty/command/printers/abstract.rb, line 48 def write(cmd, message) raise NotImplemented, "Abstract printer cannot be used" end