Class: SixthSense::Result::Finding

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#analyzer_idObject

Returns the value of attribute analyzer_id

Returns:

  • (Object)

    the current value of analyzer_id



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def analyzer_id
  @analyzer_id
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def location
  @location
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def message
  @message
end

#referencesObject

Returns the value of attribute references

Returns:

  • (Object)

    the current value of references



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def references
  @references
end

#rule_idObject

Returns the value of attribute rule_id

Returns:

  • (Object)

    the current value of rule_id



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def rule_id
  @rule_id
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def severity
  @severity
end

#suggestionObject

Returns the value of attribute suggestion

Returns:

  • (Object)

    the current value of suggestion



17
18
19
# File 'lib/sixth_sense/result.rb', line 17

def suggestion
  @suggestion
end

Instance Method Details

#to_hObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/sixth_sense/result.rb', line 27

def to_h
  {
    analyzer_id: analyzer_id,
    rule_id: rule_id,
    severity: severity,
    location: location&.to_h,
    message: message,
    references: references.map(&:to_h),
    suggestion: suggestion
  }
end