Class: Rails::Tc::TypeCheckerError

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/tc/type_checker_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, line, code, message) ⇒ TypeCheckerError

Returns a new instance of TypeCheckerError.



8
9
10
11
12
13
14
# File 'lib/rails/tc/type_checker_error.rb', line 8

def initialize(filename, line, code, message)
  @filename = filename
  @line = line
  @code = code
  @message = message
  @notes = []
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/rails/tc/type_checker_error.rb', line 6

def code
  @code
end

#filenameObject (readonly)

Returns the value of attribute filename.



6
7
8
# File 'lib/rails/tc/type_checker_error.rb', line 6

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



6
7
8
# File 'lib/rails/tc/type_checker_error.rb', line 6

def line
  @line
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/rails/tc/type_checker_error.rb', line 6

def message
  @message
end

#notesObject (readonly)

Returns the value of attribute notes.



6
7
8
# File 'lib/rails/tc/type_checker_error.rb', line 6

def notes
  @notes
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/rails/tc/type_checker_error.rb', line 16

def to_s
  "#{filename}:#{line}: #{message} https://srb.help/#{code}\n#{notes.join("\n")}"
end