Class: Pandocomatic::ErrorPrinter

Inherits:
Printer
  • Object
show all
Defined in:
lib/pandocomatic/printer/error_printer.rb

Overview

Printer for Errors in non-quiet mode

Instance Method Summary collapse

Methods inherited from Printer

#template, #to_s

Constructor Details

#initialize(error) ⇒ ErrorPrinter

Create a new ErrorPrinter



27
28
29
30
31
32
33
34
35
# File 'lib/pandocomatic/printer/error_printer.rb', line 27

def initialize(error)
  template = if error.respond_to? :template
               error.template
             else
               'error.txt'
             end
  super template
  @error = error
end

Instance Method Details

Print an Error to STDERR rather than STDOUT



38
39
40
# File 'lib/pandocomatic/printer/error_printer.rb', line 38

def print
  warn self
end