Sha256: 23d177d5376a25f95ad12438767675de5ad501385adbd0c8f0936a64a3e7cc2f

Contents?: true

Size: 1.31 KB

Versions: 21

Compression:

Stored size: 1.31 KB

Contents

module ForemanOpenscap
  module ClientConfig
    class Base
      delegate :server_param, :port_param, :policies_param, :config_item_name,
               :config_item_class_name, :override_method_name, :msg_name,
               :lookup_key_plural_name, :policies_param_default_value, :to => :constants

      def type
        raise NotImplementedError
      end

      def inline_help
        {
          :text => '',
          :replace_text => '',
          :route_helper_method => nil
        }
      end

      def managed_overrides?
        true
      end

      def available?
        raise NotImplementedError
      end

      def constants
        raise NotImplementedError
      end

      def collection_method
        constants.config_item_class_name&.pluralize&.underscore
      end

      def all_collection_method
        "all_#{collection_method}".to_sym
      end

      def find_config_item(scope = config_item_class_name.constantize)
        return unless scope
        return scope.find_by :name => config_item_name if scope.respond_to?(:find_by)
        # all_puppetclasses, all_ansible_roles methods return Array, not ActiveRecord::Relation
        scope.find { |item| item.name == config_item_name }
      end

      def ds_policies_param_default_value
        '<%= @host.policies_enc %>'
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
foreman_openscap-10.0.3 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-10.0.2 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-10.0.1 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-10.0.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-9.0.4 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-9.0.3 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-9.0.2 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-9.0.1 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-9.0.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-8.0.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-7.1.1 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-7.1.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-7.0.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-6.0.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.2.3 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.2.2 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.1.1 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.2.1 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.2.0 app/services/foreman_openscap/client_config/base.rb
foreman_openscap-5.1.0 app/services/foreman_openscap/client_config/base.rb