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.



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

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)


529
530
531
# File 'lib/abide_dev_utils/xccdf.rb', line 529

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

#include_title?(item) ⇒ Boolean

Returns:

  • (Boolean)


533
534
535
# File 'lib/abide_dev_utils/xccdf.rb', line 533

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

#levelsObject



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

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

#titlesObject



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

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