Class: Serega::CheckOptIsBool
- Inherits:
-
Object
- Object
- Serega::CheckOptIsBool
- Defined in:
- lib/serega/validations/check_opt_is_bool.rb
Class Method Summary collapse
Class Method Details
.call(opts, key) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/serega/validations/check_opt_is_bool.rb', line 5 def self.call(opts, key) return unless opts.key?(key) value = opts[key] return if value.equal?(true) || value.equal?(false) raise Error, "Invalid option #{key.inspect} => #{value.inspect}. Must have a boolean value" end |