Class: Camille::TypeErrorPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/camille/type_error_printer.rb

Constant Summary collapse

INDENTATION =
2

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ TypeErrorPrinter

Returns a new instance of TypeErrorPrinter.



5
6
7
# File 'lib/camille/type_error_printer.rb', line 5

def initialize error
  @error = error
end

Instance Method Details



9
10
11
12
13
14
15
# File 'lib/camille/type_error_printer.rb', line 9

def print io = STDOUT
  if @error.basic?
    io.puts @error.message
  else
    print_composite_error io, @error, 0
  end
end