Class: Serega::Plugins::Metadata::MetaAttribute::CheckOpts
- Inherits:
-
Object
- Object
- Serega::Plugins::Metadata::MetaAttribute::CheckOpts
- Defined in:
- lib/serega/plugins/metadata/validations/check_opts.rb
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.
20 21 22 23 24 25 26 27 28 |
# File 'lib/serega/plugins/metadata/validations/check_opts.rb', line 20 def call(opts, attribute_keys) opts.each_key do |key| next if attribute_keys.include?(key.to_sym) raise Error, "Invalid option #{key.inspect}. Allowed options are: #{attribute_keys.map(&:inspect).join(", ")}" end check_each_opt(opts) end |