Class: AbideDevUtils::XCCDF::Profiles

Inherits:
ObjectContainer show all
Defined in:
lib/abide_dev_utils/xccdf.rb

Constant Summary

Constants included from Common

Common::CIS_CONTROL_NUMBER, Common::CIS_CONTROL_PARTS, Common::CIS_LEVEL_CODE, Common::CIS_NEXT_GEN_WINDOWS, Common::CIS_PROFILE_PARTS, Common::CIS_TITLE_MARKER, Common::CONTROL_PARTS, Common::CONTROL_PREFIX, Common::PROFILE_PARTS, Common::STIG_CONTROL_PARTS, Common::STIG_PROFILE_PARTS, Common::STIG_TITLE_MARKER, Common::UNDERSCORED, Common::XPATHS

Instance Method Summary collapse

Methods inherited from ObjectContainer

#method_missing, #respond_to_missing?, #search, #to_h

Methods included from Common

#==, #abide_object?, #control_parts, #control_profile_text, #name_normalize_control, #normalize_control_name, #normalize_profile_name, #normalize_string, #number_normalize_control, #profile_parts, #text_normalize, #validate_xccdf, #xpath

Methods inherited from XccdfObject

#control_class, #control_sort_key, #controls_class

Constructor Details

#initialize(list, benchmark) ⇒ Profiles

Returns a new instance of Profiles.



506
507
508
509
510
511
# File 'lib/abide_dev_utils/xccdf.rb', line 506

def initialize(list, benchmark)
  super(list, :sorted_profile_classes, benchmark)
  searchable! :level, :title
  index! :title
  hash_key! :level, :title
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AbideDevUtils::XCCDF::ObjectContainer

Instance Method Details

#include_level?(item) ⇒ Boolean

Returns:

  • (Boolean)


521
522
523
# File 'lib/abide_dev_utils/xccdf.rb', line 521

def include_level?(item)
  levels.include?(item)
end

#include_title?(item) ⇒ Boolean

Returns:

  • (Boolean)


525
526
527
# File 'lib/abide_dev_utils/xccdf.rb', line 525

def include_title?(item)
  titles.include?(item)
end

#levelsObject



513
514
515
# File 'lib/abide_dev_utils/xccdf.rb', line 513

def levels
  @levels ||= @object_list.map(&:level).sort
end

#titlesObject



517
518
519
# File 'lib/abide_dev_utils/xccdf.rb', line 517

def titles
  @titles ||= @object_list.map(&:title).sort
end