Class: AbideDevUtils::XCCDF::Parser::Objects::Group

Inherits:
ElementWithId show all
Includes:
NumberedObject
Defined in:
lib/abide_dev_utils/xccdf/parser/objects.rb

Overview

Class for XCCDF group

Instance Attribute Summary collapse

Attributes inherited from ElementWithId

#id

Attributes inherited from ElementBase

#child_labels, #children, #link_labels

Class Method Summary collapse

Instance Method Summary collapse

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

#to_s

Methods inherited from ElementBase

#add_link, #add_links, #all_values, #find_child_by_attribute, #find_child_by_attribute_value, #find_child_by_class, #find_child_by_xpath, #find_children_by_attribute, #find_children_by_attribute_value, #find_children_by_class, #find_children_by_xpath, #find_children_that_respond_to, #label, #method_missing, #recursive_find_child, #recursive_select_children, #respond_to_missing?, #xccdf_type

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.



390
391
392
393
394
395
396
397
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 390

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

#numberObject (readonly)

Returns the value of attribute number.



388
389
390
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 388

def number
  @number
end

Class Method Details

.xpathObject



399
400
401
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 399

def self.xpath
  'xccdf:Group'
end