Class: AbideDevUtils::XCCDF::Parser::Objects::ElementWithId
- Inherits:
-
ElementBase
- Object
- ElementBase
- AbideDevUtils::XCCDF::Parser::Objects::ElementWithId
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Base class for elements that have the ID attribute
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from ElementBase
#child_labels, #children, #link_labels
Instance Method Summary collapse
-
#initialize(element) ⇒ ElementWithId
constructor
A new instance of ElementWithId.
- #to_s ⇒ Object
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, xpath
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) ⇒ ElementWithId
Returns a new instance of ElementWithId.
325 326 327 328 329 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 325 def initialize(element) super add_child(AttributeValue, element, 'id') @id = find_child_by_attribute('id').value.to_s 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
#id ⇒ Object (readonly)
Returns the value of attribute id.
323 324 325 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 323 def id @id end |
Instance Method Details
#to_s ⇒ Object
331 332 333 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 331 def to_s @id end |