Class: OpenscapParser::Benchmark

Inherits:
XmlNode
  • Object
show all
Includes:
Groups, Profiles, RuleReferences, Rules, Util, Values
Defined in:
lib/openscap_parser/benchmark.rb

Instance Attribute Summary

Attributes inherited from XmlNode

#namespaces

Instance Method Summary collapse

Methods included from Values

included

Methods included from Groups

included

Methods included from Profiles

included

Methods included from RuleReferences

included

Methods included from Rules

included

Methods included from Util

#newline_to_whitespace

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

#descriptionObject



30
31
32
33
34
35
# File 'lib/openscap_parser/benchmark.rb', line 30

def description
  @description ||= newline_to_whitespace(
    @parsed_xml.xpath('description') &&
      @parsed_xml.xpath('description').text || ''
  )
end

#idObject



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

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

#titleObject



25
26
27
28
# File 'lib/openscap_parser/benchmark.rb', line 25

def title
  @title ||= @parsed_xml.xpath('title') &&
    @parsed_xml.xpath('title').text
end

#versionObject



37
38
39
40
# File 'lib/openscap_parser/benchmark.rb', line 37

def version
  @version ||= @parsed_xml.xpath('version') &&
    @parsed_xml.xpath('version').text
end