Class: AbideDevUtils::XCCDF::Parser::Objects::Group
- Inherits:
-
ElementWithId
- Object
- ElementBase
- ElementWithId
- AbideDevUtils::XCCDF::Parser::Objects::Group
- Includes:
- NumberedObject
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Class for XCCDF group
Constant Summary
Constants inherited from ElementBase
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Attributes inherited from ElementWithId
Attributes inherited from ElementBase
#child_labels, #children, #link_labels, #links, #parent
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(element, parent_node: nil) ⇒ Group
constructor
A new instance of Group.
Methods included from NumberedObject
#<=>, #find_child_by_number, #number_child_of?, #number_eq, #number_gt, #number_lt, #number_parent_of?, #search_children_by_number
Methods inherited from ElementWithId
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, xmlns
Methods included from Helpers::XPath
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) ⇒ Group
Returns a new instance of Group.
462 463 464 465 466 467 468 469 470 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 462 def initialize(element, parent_node: nil) super @number = to_s[/group_([0-9]+\.)+[0-9]+|group_([0-9]+)/]&.gsub(/group_/, '') add_child(Title, element) add_child(Description, element) add_children(Group, element) add_children(Rule, element) similarity_methods :title, :number end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
460 461 462 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 460 def number @number end |
Class Method Details
.xpath ⇒ Object
472 473 474 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 472 def self.xpath 'Group' end |