Class: CheckstyleError

Inherits:
Struct
  • Object
show all
Defined in:
lib/checkstyle_format/checkstyle_error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def column
  @column
end

#file_nameObject

Returns the value of attribute file_name

Returns:

  • (Object)

    the current value of file_name



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def file_name
  @file_name
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def line
  @line
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def message
  @message
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def severity
  @severity
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



3
4
5
# File 'lib/checkstyle_format/checkstyle_error.rb', line 3

def source
  @source
end

Class Method Details

.generate(node, parent_node, sub_regex) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/checkstyle_format/checkstyle_error.rb', line 4

def self.generate(node, parent_node, sub_regex)
  relative_path = parent_node[:name].sub(sub_regex, "")

  CheckstyleError.new(
    relative_path,
    node[:line].to_i,
    node[:column]&.to_i,
    node[:severity],
    node[:message],
    node[:source]
  )
end