Class: AbideDevUtils::XCCDF::Parser::Objects::Rule
- Inherits:
-
ElementWithId
- Object
- ElementBase
- ElementWithId
- AbideDevUtils::XCCDF::Parser::Objects::Rule
- Includes:
- NumberedObject
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Class for XCCDF rule
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) ⇒ Rule
constructor
A new instance of Rule.
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) ⇒ Rule
Returns a new instance of Rule.
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 561 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
#number ⇒ Object (readonly)
Returns the value of attribute number.
559 560 561 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 559 def number @number end |
Class Method Details
.xpath ⇒ Object
577 578 579 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 577 def self.xpath 'Rule' end |