Class: AbideDevUtils::XCCDF::Parser::Objects::Rule

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

Overview

Class for XCCDF rule

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) ⇒ Rule

Returns a new instance of Rule.



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 618

def initialize(element)
  super
  @number = to_s[/([0-9]+\.)+[0-9]+/]
  add_child(AttributeValue, element, 'role')
  add_child(AttributeValue, element, 'selected')
  add_child(AttributeValue, element, 'weight')
  add_child(Title, element)
  add_child(Description, element)
  add_child(Rationale, element)
  add_children(Ident, element)
  add_child(Fixtext, element)
  add_children(Check, element)
  add_child(ComplexCheck, element)
  add_child(Metadata, 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.



616
617
618
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 616

def number
  @number
end

Class Method Details

.xpathObject



634
635
636
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 634

def self.xpath
  'xccdf:Rule'
end