Class: CheckstyleReports::Entity::FoundError

Inherits:
Object
  • Object
show all
Defined in:
lib/checkstyle_reports/entity/found_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_numberFixnum? (readonly)

A detected column Optionality depends on ‘source’

Returns:

  • (Fixnum, nil)


14
15
16
# File 'lib/checkstyle_reports/entity/found_error.rb', line 14

def column_number
  @column_number
end

#html_unescaped_messageString (readonly)

An error message

Returns:

  • (String)


24
25
26
# File 'lib/checkstyle_reports/entity/found_error.rb', line 24

def html_unescaped_message
  @html_unescaped_message
end

#line_numberFixnum (readonly)

A detected line number

Returns:

  • (Fixnum)


8
9
10
# File 'lib/checkstyle_reports/entity/found_error.rb', line 8

def line_number
  @line_number
end

#severityString (readonly)

A severity of this error

Returns:

  • (String)


19
20
21
# File 'lib/checkstyle_reports/entity/found_error.rb', line 19

def severity
  @severity
end

#sourceString (readonly)

A name of a detector

Returns:

  • (String)


29
30
31
# File 'lib/checkstyle_reports/entity/found_error.rb', line 29

def source
  @source
end