Class: PulpProxy::Validators::Include

Inherits:
Proxy::PluginValidators::Base
  • Object
show all
Defined in:
lib/smart_proxy_pulp_plugin/validators.rb

Instance Method Summary collapse

Instance Method Details

#validate!(settings) ⇒ Object

Raises:

  • (::Proxy::Error::ConfigurationError)


6
7
8
9
10
11
12
13
# File 'lib/smart_proxy_pulp_plugin/validators.rb', line 6

def validate!(settings)
  setting_value = settings[@setting_name]
  return true if (setting_value - @params).empty?

  # rubocop:disable Layout/LineLength
  raise ::Proxy::Error::ConfigurationError, "Parameter '#{@setting_name}' is expected to be one or more of #{@params}"
  # rubocop:enable Layout/LineLength
end