Class: OpenscapParser::TestResult
Instance Attribute Summary
Attributes inherited from XmlNode
#namespaces
Instance Method Summary
collapse
Methods included from SetValues
included
included
Methods inherited from XmlNode
#initialize, #parsed_xml, #text, #xpath_node, #xpath_nodes
Instance Method Details
#benchmark_id ⇒ Object
40
41
42
43
|
# File 'lib/openscap_parser/test_result.rb', line 40
def benchmark_id
@benchmark_id ||= parsed_xml.at_xpath('benchmark') &&
parsed_xml.at_xpath('benchmark')['id'] || ''
end
|
#end_time ⇒ Object
58
59
60
|
# File 'lib/openscap_parser/test_result.rb', line 58
def end_time
@end_time ||= DateTime.parse(parsed_xml['end-time'])
end
|
#identity ⇒ Object
30
31
32
33
|
# File 'lib/openscap_parser/test_result.rb', line 30
def identity
@identity ||= parsed_xml.at_xpath('identity') &&
parsed_xml.at_xpath('identity').text || ''
end
|
21
22
23
|
# File 'lib/openscap_parser/test_result.rb', line 21
def platform_nodes
@platform_nodes ||= parsed_xml.xpath('platform')
end
|
#profile_id ⇒ Object
35
36
37
38
|
# File 'lib/openscap_parser/test_result.rb', line 35
def profile_id
@profile_id ||= parsed_xml.at_xpath('profile') &&
parsed_xml.at_xpath('profile')['idref'] || ''
end
|
#score ⇒ Object
49
50
51
52
|
# File 'lib/openscap_parser/test_result.rb', line 49
def score
@score ||= parsed_xml.at_xpath('score') &&
parsed_xml.at_xpath('score').text.to_f
end
|
#set_value_nodes ⇒ Object
45
46
47
|
# File 'lib/openscap_parser/test_result.rb', line 45
def set_value_nodes
@set_value_nodes ||= parsed_xml.xpath('set-value')
end
|
#start_time ⇒ Object
54
55
56
|
# File 'lib/openscap_parser/test_result.rb', line 54
def start_time
@start_time ||= DateTime.parse(parsed_xml['start-time'])
end
|
#target ⇒ Object
Also known as:
host
11
12
13
14
|
# File 'lib/openscap_parser/test_result.rb', line 11
def target
@target ||= parsed_xml.at_xpath('target') &&
parsed_xml.at_xpath('target').text || ''
end
|
#target_fact_nodes ⇒ Object
17
18
19
|
# File 'lib/openscap_parser/test_result.rb', line 17
def target_fact_nodes
@target_fact_nodes ||= parsed_xml.xpath('target-facts/fact')
end
|
#title ⇒ Object
25
26
27
28
|
# File 'lib/openscap_parser/test_result.rb', line 25
def title
@title ||= parsed_xml.at_xpath('title') &&
parsed_xml.at_xpath('title').text || ''
end
|