Class: DearInventory::Validators::Required
- Inherits:
-
DearInventory::Validator
- Object
- DearInventory::Validator
- DearInventory::Validators::Required
- Extended by:
- T::Sig
- Defined in:
- lib/dear_inventory/validators/required.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 |
# File 'lib/dear_inventory/validators/required.rb', line 10 def call return if present?(instance_variable_get(:@value)) raise_error("the field is required but no value was provided") end |