Class: Serega::SeregaValidations::Utils::CheckOptIsHash
- Inherits:
-
Object
- Object
- Serega::SeregaValidations::Utils::CheckOptIsHash
- Defined in:
- lib/serega/validations/utils/check_opt_is_hash.rb
Overview
Utility to check hash key value is Hash
Class Method Summary collapse
-
.call(opts, key) ⇒ void
Checks hash key value is Hash.
Class Method Details
.call(opts, key) ⇒ void
This method returns an undefined value.
Checks hash key value is Hash
18 19 20 21 22 23 24 25 |
# File 'lib/serega/validations/utils/check_opt_is_hash.rb', line 18 def self.call(opts, key) return unless opts.key?(key) value = opts[key] return if value.is_a?(Hash) raise SeregaError, "Invalid option #{key.inspect} => #{value.inspect}. Must have a Hash value" end |