Class: AbideDevUtils::XCCDF::Parser::Objects::System

Inherits:
ElementBase
  • Object
show all
Defined in:
lib/abide_dev_utils/xccdf/parser/objects.rb

Overview

Class for XCCDF Ident System element

Constant Summary

Constants inherited from ElementBase

ElementBase::UNICODE_SYMBOLS

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#child_labels, #children, #link_labels, #links, #parent

Instance Method Summary collapse

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

#find_element

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

Returns a new instance of System.



576
577
578
579
580
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 576

def initialize(element, parent_node: nil)
  super
  @system = element.attributes['system'].value
  @text = element.text
end

Instance Attribute Details

#systemObject (readonly)

Returns the value of attribute system.



574
575
576
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 574

def system
  @system
end

#textObject (readonly)

Returns the value of attribute text.



574
575
576
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 574

def text
  @text
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


582
583
584
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 582

def eql?(other)
  to_s == other.to_s
end

#hashObject



586
587
588
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 586

def hash
  to_s.hash
end

#to_sObject



590
591
592
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 590

def to_s
  [label, @system, @text].join(':')
end