class OpenscapParser::Rule
Public Instance Methods
description()
click to toggle source
# File lib/openscap_parser/rule.rb, line 31 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 14 def id @id ||= parsed_xml['id'] end
identifier_node()
click to toggle source
# File lib/openscap_parser/rule.rb, line 55 def identifier_node @identifier_node ||= parsed_xml.at_xpath('ident') end
rationale()
click to toggle source
# File lib/openscap_parser/rule.rb, line 38 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 50 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 46 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 18 def selected @selected ||= parsed_xml['selected'] end
severity()
click to toggle source
# File lib/openscap_parser/rule.rb, line 22 def severity @severity ||= parsed_xml['severity'] end
title()
click to toggle source
# File lib/openscap_parser/rule.rb, line 26 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 59 def to_h { :id => id, :selected => selected, :severity => severity, :title => title, :description => description, :rationale => rationale, :identifier => rule_identifier.to_h } end