Class: Serega::Validations::Utils::CheckOptIsHash
- Inherits:
-
Object
- Object
- Serega::Validations::Utils::CheckOptIsHash
- Defined in:
- lib/serega/validations/utils/check_opt_is_hash.rb
Class Method Summary collapse
Class Method Details
.call(opts, key) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/serega/validations/utils/check_opt_is_hash.rb', line 7 def self.call(opts, key) return unless opts.key?(key) value = opts[key] return if value.is_a?(Hash) raise Error, "Invalid option #{key.inspect} => #{value.inspect}. Must have a Hash value" end |