Module: AbideDevUtils::CEM::Mapping::MixinSTIG

Defined in:
lib/abide_dev_utils/cem/mapping/mapper.rb

Overview

Mixin module used by Mapper to implement STIG-specific mapping behavior

Instance Method Summary collapse

Instance Method Details

#get_map(control_id, level: nil, **_) ⇒ Object



270
271
272
273
274
275
276
277
278
279
280
# File 'lib/abide_dev_utils/cem/mapping/mapper.rb', line 270

def get_map(control_id, level: nil, **_)
  mtype, mtop = map_type_and_top_key(control_id)
  return unless STIG_TYPES.include?(mtype)
  return map_data[mtype][mtop][level][control_id] unless level.nil?

  map_data[mtype][mtop].each do |lvl, control_hash|
    next if lvl == 'benchmark'

    return control_hash[control_id] if control_hash.key?(control_id)
  end
end