class OpenscapParser::Rule
Public Instance Methods
description()
click to toggle source
# File lib/openscap_parser/rule.rb, line 32 def description @description ||= newline_to_whitespace( parsed_xml.at_css('description') && parsed_xml.at_css('description').text || '' ) end
id()
click to toggle source
# File lib/openscap_parser/rule.rb, line 15 def id @id ||= parsed_xml['id'] end
identifier_node()
click to toggle source
# File lib/openscap_parser/rule.rb, line 56 def identifier_node @identifier_node ||= parsed_xml.at_xpath('ident') end
rationale()
click to toggle source
# File lib/openscap_parser/rule.rb, line 39 def rationale @rationale ||= newline_to_whitespace( parsed_xml.at_css('rationale') && parsed_xml.at_css('rationale').text || '' ) end
rule_identifier()
click to toggle source
# File lib/openscap_parser/rule.rb, line 51 def rule_identifier @identifier ||= RuleIdentifier.new(parsed_xml: identifier_node) end
Also aliased as: identifier
rule_reference_nodes(xpath = "reference")
click to toggle source
# File lib/openscap_parser/rule.rb, line 47 def rule_reference_nodes(xpath = "reference") rule_reference_nodes_old(xpath) end
Also aliased as: rule_reference_nodes_old
selected()
click to toggle source
# File lib/openscap_parser/rule.rb, line 19 def selected @selected ||= parsed_xml['selected'] end
severity()
click to toggle source
# File lib/openscap_parser/rule.rb, line 23 def severity @severity ||= parsed_xml['severity'] end
title()
click to toggle source
# File lib/openscap_parser/rule.rb, line 27 def title @title ||= parsed_xml.at_css('title') && parsed_xml.at_css('title').text end
to_h()
click to toggle source
# File lib/openscap_parser/rule.rb, line 60 def to_h { :id => id, :selected => selected, :severity => severity, :title => title, :description => description, :rationale => rationale, :identifier => rule_identifier.to_h } end