Class: Problem

Inherits:
Struct
  • Object
show all
Defined in:
lib/inspect/problem.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



1
2
3
# File 'lib/inspect/problem.rb', line 1

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



1
2
3
# File 'lib/inspect/problem.rb', line 1

def line
  @line
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



1
2
3
# File 'lib/inspect/problem.rb', line 1

def message
  @message
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



1
2
3
# File 'lib/inspect/problem.rb', line 1

def severity
  @severity
end

Class Method Details

.generate(node) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/inspect/problem.rb', line 3

def self.generate(node)
  Problem.new(
    node.get_elements('file').first.text.gsub('file://$PROJECT_DIR$/', ''),
    node.get_elements('line').first.text.to_i,
    node.get_elements('description').first.text,
    node.get_elements('problem_class').first.attributes['severity']
  )
end