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
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
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(element) ⇒ 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, #label, #method_missing, #respond_to_missing?, #xccdf_type, xmlns
Methods included from Helpers::XPath
Methods included from Helpers::ElementChildren
Methods included from DigestObject
#digest, #digest_equal?, #digest_similarity, #digestable_instance_variables, #exclude_from_digest, #labeled_self_digest, #non_compatible?, #normalize_exclusion, #sorted_digest_parts, #split_labeled_digest
Constructor Details
#initialize(element) ⇒ Group
Returns a new instance of Group.
316 317 318 319 320 321 322 323 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 316 def initialize(element) 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) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AbideDevUtils::XCCDF::Parser::Objects::ElementBase
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
314 315 316 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 314 def number @number end |
Class Method Details
.xpath ⇒ Object
325 326 327 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 325 def self.xpath 'Group' end |