Class: Serega::SeregaValidations::SeregaUtils::CheckAllowedKeys
- Inherits:
-
Object
- Object
- Serega::SeregaValidations::SeregaUtils::CheckAllowedKeys
- Defined in:
- lib/serega/validations/utils/check_allowed_keys.rb
Class Method Summary collapse
Class Method Details
.call(opts, allowed_keys) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/serega/validations/utils/check_allowed_keys.rb', line 7 def self.call(opts, allowed_keys) opts.each_key do |key| next if allowed_keys.include?(key) raise SeregaError, "Invalid option #{key.inspect}. Allowed options are: #{allowed_keys.map(&:inspect).join(", ")}" end end |