Class: AbideDevUtils::XCCDF::Parser::Objects::XccdfSelect

Inherits:
ElementWithIdref show all
Defined in:
lib/abide_dev_utils/xccdf/parser/objects.rb

Overview

Class for an XCCDF select element

Constant Summary

Constants inherited from ElementBase

ElementBase::UNICODE_SYMBOLS

Instance Attribute Summary collapse

Attributes inherited from ElementWithIdref

#idref

Attributes inherited from ElementBase

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ElementWithIdref

#<=>, #eql?, #hash, #to_s

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

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

Returns a new instance of XccdfSelect.



421
422
423
424
425
426
427
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 421

def initialize(element, parent_node: nil)
  super
  add_child(AttributeValue, element, 'selected')
  @number = to_s[/([0-9]+\.)+[0-9]+|([0-9]+)/]
  @title = to_s[/[A-Z].*$/]
  similarity_methods :number, :title
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



419
420
421
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 419

def number
  @number
end

#titleObject (readonly)

Returns the value of attribute title.



419
420
421
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 419

def title
  @title
end

Class Method Details

.xpathObject



429
430
431
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 429

def self.xpath
  'select'
end