class Helium::Console::ColorPrinter

Public Class Methods

pp(obj, output = $DEFAULT_OUTPUT, max_width = 79) click to toggle source
# File lib/helium/console/printer.rb, line 6
def self.pp(obj, output = $DEFAULT_OUTPUT, max_width = 79)
  queue = ColorPrinter.new(output, max_width, "\n")
  queue.guard_inspect_key { queue.pp(obj) }
  queue.flush
  output << "\n"
end

Public Instance Methods

pp(object) click to toggle source
# File lib/helium/console/printer.rb, line 13
def pp(object)
  formatted = Helium::Console.format(object)
  output << "\n" if object.is_a? Registry::Element::LazyStringEvaluator
  formatted.lines.each do |line|
    output << "#{line.chomp}\n"
  end
  output << "\n"
end