Class: AbideDevUtils::XCCDF::CisControls

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

Constant Summary

Constants included from Common

AbideDevUtils::XCCDF::Common::CIS_CONTROL_NUMBER, AbideDevUtils::XCCDF::Common::CIS_CONTROL_PARTS, AbideDevUtils::XCCDF::Common::CIS_LEVEL_CODE, AbideDevUtils::XCCDF::Common::CIS_NEXT_GEN_WINDOWS, AbideDevUtils::XCCDF::Common::CIS_PROFILE_PARTS, AbideDevUtils::XCCDF::Common::CIS_TITLE_MARKER, AbideDevUtils::XCCDF::Common::CONTROL_PARTS, AbideDevUtils::XCCDF::Common::CONTROL_PREFIX, AbideDevUtils::XCCDF::Common::PROFILE_PARTS, AbideDevUtils::XCCDF::Common::STIG_CONTROL_PARTS, AbideDevUtils::XCCDF::Common::STIG_PROFILE_PARTS, AbideDevUtils::XCCDF::Common::STIG_TITLE_MARKER, AbideDevUtils::XCCDF::Common::UNDERSCORED, AbideDevUtils::XCCDF::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) ⇒ CisControls

Returns a new instance of CisControls.



556
557
558
559
560
561
# File 'lib/abide_dev_utils/xccdf.rb', line 556

def initialize(list, benchmark)
  super(list, :sorted_control_classes, benchmark)
  searchable! :level, :title, :number
  index! :number
  hash_key! :number
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)


579
580
581
# File 'lib/abide_dev_utils/xccdf.rb', line 579

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

#include_number?(item) ⇒ Boolean

Returns:

  • (Boolean)


575
576
577
# File 'lib/abide_dev_utils/xccdf.rb', line 575

def include_number?(item)
  numbers.include?(item)
end

#include_title?(item) ⇒ Boolean

Returns:

  • (Boolean)


583
584
585
# File 'lib/abide_dev_utils/xccdf.rb', line 583

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

#levelsObject



567
568
569
# File 'lib/abide_dev_utils/xccdf.rb', line 567

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

#numbersObject



563
564
565
# File 'lib/abide_dev_utils/xccdf.rb', line 563

def numbers
  @numbers ||= @object_list.map(&:number).sort
end

#titlesObject



571
572
573
# File 'lib/abide_dev_utils/xccdf.rb', line 571

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