Class: AbideDevUtils::XCCDF::Parser::Objects::ElementWithIdref
- Inherits:
-
ElementBase
- Object
- ElementBase
- AbideDevUtils::XCCDF::Parser::Objects::ElementWithIdref
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Base class for elements that have the idref attribute
Direct Known Subclasses
Constant Summary
Constants inherited from ElementBase
AbideDevUtils::XCCDF::Parser::Objects::ElementBase::UNICODE_SYMBOLS
Instance Attribute Summary collapse
-
#idref ⇒ Object
readonly
Returns the value of attribute idref.
Attributes inherited from ElementBase
#child_labels, #children, #link_labels, #links, #parent
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(element, parent_node: nil) ⇒ ElementWithIdref
constructor
A new instance of ElementWithIdref.
- #to_s ⇒ Object
Methods inherited from ElementBase
#add_link, #add_links, #all_values, #ancestors, #depth, #descendants, #find_similarity, #inspect, #label, #leaf?, #print_tree, #root, #root?, #siblings, #xccdf_type, xmlns, xpath
Methods included from Helpers::XPath
Methods included from DiffableObject
#check_diffable!, #correlate_added_removed, #diff, #diff_ambiguous, #diff_array_obj, #diff_benchmark, #diff_change_result, #diff_check, #diff_complex_check, #diff_group, #diff_plain_obj, #diff_profile, #diff_rule, #diff_str_obj, #diff_value, #diff_xccdf_select, #process_details_hash!, #result_from_details_hash
Constructor Details
#initialize(element, parent_node: nil) ⇒ ElementWithIdref
Returns a new instance of ElementWithIdref.
392 393 394 395 396 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 392 def initialize(element, parent_node: nil) super add_child(AttributeValue, element, 'idref') @idref = descendants.find { |d| d.label == 'idref' }.value end |
Instance Attribute Details
#idref ⇒ Object (readonly)
Returns the value of attribute idref.
390 391 392 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 390 def idref @idref end |
Instance Method Details
#<=>(other) ⇒ Object
398 399 400 401 402 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 398 def <=>(other) return nil unless other.instance_of?(self.class) @idref <=> other.idref.value end |
#eql?(other) ⇒ Boolean
404 405 406 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 404 def eql?(other) @idref == other.idref.value end |
#hash ⇒ Object
408 409 410 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 408 def hash @idref.hash end |
#to_s ⇒ Object
412 413 414 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 412 def to_s @idref end |