Class: OpenscapParser::RuleResult
- Inherits:
-
XmlNode
- Object
- XmlNode
- OpenscapParser::RuleResult
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
Instance Method Details
#id ⇒ Object
5
6
7
|
# File 'lib/openscap_parser/rule_result.rb', line 5
def id
@id ||= parsed_xml['idref']
end
|
#result ⇒ Object
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
|
#severity ⇒ Object
13
14
15
|
# File 'lib/openscap_parser/rule_result.rb', line 13
def severity
@severity ||= parsed_xml['severity']
end
|
#time ⇒ Object
9
10
11
|
# File 'lib/openscap_parser/rule_result.rb', line 9
def time
@time ||= parsed_xml['time']
end
|
#to_h ⇒ Object
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
|
#weight ⇒ Object
17
18
19
|
# File 'lib/openscap_parser/rule_result.rb', line 17
def weight
@weight ||= parsed_xml['weight']
end
|