Class: DearInventory::Validators::Integer

Inherits:
DearInventory::Validator show all
Extended by:
T::Sig
Defined in:
lib/dear_inventory/validators/integer.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
15
16
# File 'lib/dear_inventory/validators/integer.rb', line 10

def call
  value = instance_variable_get(:@value)
  return if value.nil?
  return if value.is_a?(::Integer)

  raise_error("expected an Integer but received #{value.inspect}")
end