Class: ForemanOpenscap::ClientConfig::Base
- Inherits:
-
Object
- Object
- ForemanOpenscap::ClientConfig::Base
- Defined in:
- app/services/foreman_openscap/client_config/base.rb
Instance Method Summary collapse
- #all_collection_method ⇒ Object
- #available? ⇒ Boolean
- #collection_method ⇒ Object
- #constants ⇒ Object
- #ds_policies_param_default_value ⇒ Object
- #find_config_item(scope = config_item_class_name.constantize) ⇒ Object
- #inline_help ⇒ Object
- #managed_overrides? ⇒ Boolean
- #type ⇒ Object
Instance Method Details
#all_collection_method ⇒ Object
36 37 38 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 36 def all_collection_method "all_#{collection_method}".to_sym end |
#available? ⇒ Boolean
24 25 26 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 24 def available? raise NotImplementedError end |
#collection_method ⇒ Object
32 33 34 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 32 def collection_method constants.config_item_class_name&.pluralize&.underscore end |
#constants ⇒ Object
28 29 30 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 28 def constants raise NotImplementedError end |
#ds_policies_param_default_value ⇒ Object
47 48 49 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 47 def ds_policies_param_default_value '<%= @host.policies_enc %>' end |
#find_config_item(scope = config_item_class_name.constantize) ⇒ Object
40 41 42 43 44 45 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 40 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 |
#inline_help ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 12 def inline_help { :text => '', :replace_text => '', :route_helper_method => nil } end |
#managed_overrides? ⇒ Boolean
20 21 22 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 20 def managed_overrides? true end |
#type ⇒ Object
8 9 10 |
# File 'app/services/foreman_openscap/client_config/base.rb', line 8 def type raise NotImplementedError end |