Class: Castkit::Validators::IntegerValidator
- Inherits:
-
NumericValidator
- Object
- Base
- NumericValidator
- Castkit::Validators::IntegerValidator
- Defined in:
- lib/castkit/validators/integer_validator.rb
Overview
Validator for Integer attributes.
Ensures the value is an instance of ‘Integer` and optionally checks numerical constraints such as `min` and `max`, inherited from `Castkit::Validators::NumericValidator`.
Instance Method Summary collapse
-
#call(value, options:, context:) ⇒ void
Validates the Integer value.
Methods inherited from Base
Instance Method Details
#call(value, options:, context:) ⇒ void
This method returns an undefined value.
Validates the Integer value.
24 25 26 27 28 |
# File 'lib/castkit/validators/integer_validator.rb', line 24 def call(value, options:, context:) return type_error!(:integer, value, context: context) unless value.is_a?(::Integer) super end |