-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbenchmark.rb
More file actions
38 lines (32 loc) · 958 Bytes
/
benchmark.rb
File metadata and controls
38 lines (32 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'openscap_results_parser/util'
require 'openscap_results_parser/xml_file'
require 'openscap_results_parser/rules'
require 'openscap_results_parser/profiles'
require 'openscap_results_parser/rule_references'
# Mimics openscap-ruby Benchmark interface
module OpenscapParser
class Benchmark < XmlNode
include OpenscapParser::Util
include OpenscapParser::Rules
include OpenscapParser::RuleReferences
include OpenscapParser::Profiles
def id
@id ||= @parsed_xml['id']
end
def title
@title ||= @parsed_xml.xpath('title') &&
@parsed_xml.xpath('title').text
end
def description
@description ||= newline_to_whitespace(
@parsed_xml.xpath('description') &&
@parsed_xml.xpath('description').text || ''
)
end
def version
@version ||= @parsed_xml.xpath('version') &&
@parsed_xml.xpath('version').text
end
end
end