Sha256: 451bdaeb21b8254f49a6c160dc3524290c7b960399e09287de97f58f7bf62c0b

Contents?: true

Size: 677 Bytes

Versions: 32

Compression:

Stored size: 677 Bytes

Contents

module ForemanOpenscap
  class ConfigNameService
    attr_reader :configs

    def initialize
      @configs = [
        ForemanOpenscap::ClientConfig::Ansible.new,
        ForemanOpenscap::ClientConfig::Puppet.new,
        ForemanOpenscap::ClientConfig::Manual.new
      ]
    end

    def config_for(type)
      @configs.find { |config| config.type == type }
    end

    def all_except(type)
      @configs.reject { |config| config.type == type }
    end

    def all_available_except(type)
      all_except(type).select(&:available?)
    end

    def all_available_with_overrides_except(type)
      all_available_except(type).select(&:managed_overrides?)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
foreman_openscap-4.1.3 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.6 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.2.0 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.5 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.1.2 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.1.1 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.1.0 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.4 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.3 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.2 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.1 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-3.0.1 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-4.0.0 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-3.0.0 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-2.0.2 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-1.0.10 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-2.0.1 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-1.0.9 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-2.0.0 app/services/foreman_openscap/config_name_service.rb
foreman_openscap-1.0.8 app/services/foreman_openscap/config_name_service.rb