Class: Steep::Drivers::SignatureErrorPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/drivers/signature_error_printer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout:, stderr:) ⇒ SignatureErrorPrinter

Returns a new instance of SignatureErrorPrinter.



7
8
9
10
# File 'lib/steep/drivers/signature_error_printer.rb', line 7

def initialize(stdout:, stderr:)
  @stdout = stdout
  @stderr = stderr
end

Instance Attribute Details

#stderrObject (readonly)

Returns the value of attribute stderr.



5
6
7
# File 'lib/steep/drivers/signature_error_printer.rb', line 5

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



4
5
6
# File 'lib/steep/drivers/signature_error_printer.rb', line 4

def stdout
  @stdout
end

Instance Method Details



18
19
20
21
22
# File 'lib/steep/drivers/signature_error_printer.rb', line 18

def print_semantic_errors(errors)
  errors.each do |error|
    error.puts stderr
  end
end


12
13
14
15
16
# File 'lib/steep/drivers/signature_error_printer.rb', line 12

def print_syntax_errors(errors)
  errors.each do |error|
    stderr.puts error.message
  end
end