Class: DearInventory::Validators::Required

Inherits:
DearInventory::Validator show all
Extended by:
T::Sig
Defined in:
lib/dear_inventory/validators/required.rb

Instance Method Summary collapse

Methods inherited from DearInventory::Validator

call, #initialize

Constructor Details

This class inherits a constructor from DearInventory::Validator

Instance Method Details

#callObject



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