Class: Serega::SeregaPlugins::Metadata::MetaAttribute::CheckOpts
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Metadata::MetaAttribute::CheckOpts
- Defined in:
- lib/serega/plugins/metadata/validations/check_opts.rb
Overview
Validator for meta_attribute options
Class Method Summary collapse
-
.call(opts, attribute_keys) ⇒ void
Validates attribute options Checks used options are allowed and then checks options values.
Class Method Details
.call(opts, attribute_keys) ⇒ void
This method returns an undefined value.
Validates attribute options Checks used options are allowed and then checks options values.
23 24 25 26 27 28 29 30 31 |
# File 'lib/serega/plugins/metadata/validations/check_opts.rb', line 23 def call(opts, attribute_keys) opts.each_key do |key| next if attribute_keys.include?(key.to_sym) raise SeregaError, "Invalid option #{key.inspect}. Allowed options are: #{attribute_keys.map(&:inspect).join(", ")}" end check_each_opt(opts) end |