Class: DearInventory::Validators::Boolean
- Inherits:
-
DearInventory::Validator
- Object
- DearInventory::Validator
- DearInventory::Validators::Boolean
- Extended by:
- T::Sig
- Defined in:
- lib/dear_inventory/validators/boolean.rb
Instance Method Summary collapse
Methods inherited from DearInventory::Validator
Constructor Details
This class inherits a constructor from DearInventory::Validator
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 |
# File 'lib/dear_inventory/validators/boolean.rb', line 10 def call value = instance_variable_get(:@value) return if [true, false, nil].include?(value) raise_error("expected a Boolean but received #{value.inspect}") end |