Class: ComplianceEngine::Ces

Inherits:
Collection show all
Defined in:
lib/compliance_engine/ces.rb

Overview

A collection of compliance engine data CEs

Instance Attribute Summary

Attributes inherited from Collection

#collection, #enforcement_tolerance, #environment_data, #facts

Instance Method Summary collapse

Methods inherited from Collection

#[], #all?, #any?, #each, #each_key, #each_value, #initialize, #invalidate_cache, #keys, #reject, #select, #to_h

Constructor Details

This class inherits a constructor from ComplianceEngine::Collection

Instance Method Details

#by_oval_idHash

A Hash of CEs by OVAL ID

Returns:

  • (Hash)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/compliance_engine/ces.rb', line 10

def by_oval_id
  return @by_oval_id unless @by_oval_id.nil?

  @by_oval_id ||= {}

  each do |k, v|
    v.oval_ids&.each do |oval_id|
      @by_oval_id[oval_id] ||= {}
      @by_oval_id[oval_id][k] = v
    end
  end

  @by_oval_id
end