Class: LibRubyParser::Diagnostic

Inherits:
Object
  • Object
show all
Defined in:
lib/lib-ruby-parser.rb

Overview

Diagnostic message that comes from the parser when there’s an error or warning

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level:, message:, loc:) ⇒ Diagnostic

Returns a new instance of Diagnostic.

Parameters:



91
92
93
94
95
# File 'lib/lib-ruby-parser.rb', line 91

def initialize(level:, message:, loc:)
  @level = level
  @message = message
  @loc = loc
end

Instance Attribute Details

#levelSymbol

Level of the diagnostic (+:error+ or +:warning+)

Returns:

  • (Symbol)

    +:error+ or +:warning+



76
77
78
# File 'lib/lib-ruby-parser.rb', line 76

def level
  @level
end

#locLoc

Location of the diagnostic

Returns:



86
87
88
# File 'lib/lib-ruby-parser.rb', line 86

def loc
  @loc
end

#messageDiagnosticMessage

Message of the diagnostic

Returns:



81
82
83
# File 'lib/lib-ruby-parser.rb', line 81

def message
  @message
end