Class: CheckstyleReports::Entity::FoundError
- Inherits:
-
Object
- Object
- CheckstyleReports::Entity::FoundError
- Defined in:
- lib/checkstyle_reports/entity/found_error.rb
Instance Attribute Summary collapse
-
#column_number ⇒ Fixnum?
readonly
A detected column Optionality depends on ‘source’.
-
#html_unescaped_message ⇒ String
readonly
An error message.
-
#line_number ⇒ Fixnum
readonly
A detected line number.
-
#severity ⇒ String
readonly
A severity of this error.
-
#source ⇒ String
readonly
A name of a detector.
Instance Method Summary collapse
-
#initialize(node) ⇒ FoundError
constructor
A new instance of FoundError.
Constructor Details
#initialize(node) ⇒ FoundError
Returns a new instance of FoundError.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 31 def initialize(node) raise "Wrong node was passed. expected error but #{node.name}" if node.name != "error" attributes = node.attributes @line_number = attributes["line"].to_i @column_number = attributes["column"]&.to_i @severity = attributes["severity"] @html_unescaped_message = attributes["message"] # unescape implicitly @source = attributes["source"] end |
Instance Attribute Details
#column_number ⇒ Fixnum? (readonly)
A detected column Optionality depends on ‘source’
14 15 16 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 14 def column_number @column_number end |
#html_unescaped_message ⇒ String (readonly)
An error message
24 25 26 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 24 def @html_unescaped_message end |
#line_number ⇒ Fixnum (readonly)
A detected line number
8 9 10 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 8 def line_number @line_number end |
#severity ⇒ String (readonly)
A severity of this error
19 20 21 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 19 def severity @severity end |
#source ⇒ String (readonly)
A name of a detector
29 30 31 |
# File 'lib/checkstyle_reports/entity/found_error.rb', line 29 def source @source end |