Class: OpenscapParser::RuleResult

Inherits:
XmlNode
  • Object
show all
Defined in:
lib/openscap_parser/rule_result.rb

Instance Attribute Summary

Attributes inherited from XmlNode

#namespaces

Instance Method Summary collapse

Methods inherited from XmlNode

#initialize, #parsed_xml, #text, #xpath_node, #xpath_nodes

Constructor Details

This class inherits a constructor from OpenscapParser::XmlNode

Instance Method Details

#idObject



5
6
7
# File 'lib/openscap_parser/rule_result.rb', line 5

def id
  @id ||= parsed_xml['idref']
end

#resultObject



21
22
23
24
# File 'lib/openscap_parser/rule_result.rb', line 21

def result
  @result ||= parsed_xml.at_xpath('result') &&
    parsed_xml.at_xpath('result').text || ''
end

#severityObject



13
14
15
# File 'lib/openscap_parser/rule_result.rb', line 13

def severity
  @severity ||= parsed_xml['severity']
end

#timeObject



9
10
11
# File 'lib/openscap_parser/rule_result.rb', line 9

def time
  @time ||= parsed_xml['time']
end

#to_hObject



26
27
28
29
30
31
32
33
34
# File 'lib/openscap_parser/rule_result.rb', line 26

def to_h
  {
    :id => id,
    :time => time,
    :severity => severity,
    :weight => weight,
    :result => result
  }
end

#weightObject



17
18
19
# File 'lib/openscap_parser/rule_result.rb', line 17

def weight
  @weight ||= parsed_xml['weight']
end