Class: AbideDevUtils::XCCDF::Parser::Objects::MetadataCisControlsFrameworkSafeguard

Inherits:
ElementBase
  • Object
show all
Defined in:
lib/abide_dev_utils/xccdf/parser/objects.rb

Overview

Class for XCCDF rule metadata cis_controls framework safeguard

Constant Summary

Constants inherited from ElementBase

ElementBase::UNICODE_SYMBOLS

Instance Attribute Summary

Attributes inherited from ElementBase

#child_labels, #children, #link_labels, #links, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ElementBase

#<=>, #add_link, #add_links, #all_values, #ancestors, #depth, #descendants, #find_similarity, #inspect, #label, #leaf?, #print_tree, #root, #root?, #siblings, #xccdf_type

Methods included from Helpers::XPath

#find_element

Methods included from DiffableObject

#check_diffable!, #correlate_added_removed, #diff, #diff_ambiguous, #diff_array_obj, #diff_benchmark, #diff_change_result, #diff_check, #diff_complex_check, #diff_group, #diff_plain_obj, #diff_profile, #diff_rule, #diff_str_obj, #diff_value, #diff_xccdf_select, #process_details_hash!, #result_from_details_hash

Constructor Details

#initialize(element, parent_node: nil) ⇒ MetadataCisControlsFrameworkSafeguard

Returns a new instance of MetadataCisControlsFrameworkSafeguard.



645
646
647
648
649
650
651
652
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 645

def initialize(element, parent_node: nil)
  super
  add_child(ShortText, element['title'])
  add_child(ShortText, element['urn'])
  new_implementation_groups(element)
  add_child(ShortText, find_element.at_xpath(element, 'asset_type').text)
  add_child(ShortText, find_element.at_xpath(element, 'security_function').text)
end

Class Method Details

.xmlnsObject



666
667
668
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 666

def self.xmlns
  'controls'
end

.xpathObject



662
663
664
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 662

def self.xpath
  'safeguard'
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


654
655
656
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 654

def eql?(other)
  @children.map(&:to_s).join == other.children.map(&:to_s).join
end

#hashObject



658
659
660
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 658

def hash
  @children.map(&:hash).join.hash
end