Class: Rigor::Analysis::Diagnostic
- Inherits:
-
Object
- Object
- Rigor::Analysis::Diagnostic
- Defined in:
- lib/rigor/analysis/diagnostic.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(path:, line:, column:, message:, severity: :error) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path:, line:, column:, message:, severity: :error) ⇒ Diagnostic
Returns a new instance of Diagnostic.
8 9 10 11 12 13 14 |
# File 'lib/rigor/analysis/diagnostic.rb', line 8 def initialize(path:, line:, column:, message:, severity: :error) @path = path @line = line @column = column @message = @severity = severity end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
6 7 8 |
# File 'lib/rigor/analysis/diagnostic.rb', line 6 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
6 7 8 |
# File 'lib/rigor/analysis/diagnostic.rb', line 6 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/rigor/analysis/diagnostic.rb', line 6 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/rigor/analysis/diagnostic.rb', line 6 def path @path end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
6 7 8 |
# File 'lib/rigor/analysis/diagnostic.rb', line 6 def severity @severity end |
Instance Method Details
#error? ⇒ Boolean
16 17 18 |
# File 'lib/rigor/analysis/diagnostic.rb', line 16 def error? severity == :error end |
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/rigor/analysis/diagnostic.rb', line 20 def to_h { "path" => path, "line" => line, "column" => column, "severity" => severity.to_s, "message" => } end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/rigor/analysis/diagnostic.rb', line 30 def to_s "#{path}:#{line}:#{column}: #{severity}: #{}" end |