Class: Castkit::Validators::FloatValidator
- Inherits:
-
NumericValidator
- Object
- Base
- NumericValidator
- Castkit::Validators::FloatValidator
- Defined in:
- lib/castkit/validators/float_validator.rb
Overview
Validator for Float attributes.
Ensures the value is a ‘Float`, and applies any numeric bounds (`min`, `max`) defined in the attribute options. Inherits shared logic from `NumericValidator`.
Instance Method Summary collapse
-
#call(value, options:, context:) ⇒ void
Validates that the value is a Float and within optional bounds.
Methods inherited from Base
Instance Method Details
#call(value, options:, context:) ⇒ void
This method returns an undefined value.
Validates that the value is a Float and within optional bounds.
24 25 26 27 28 |
# File 'lib/castkit/validators/float_validator.rb', line 24 def call(value, options:, context:) return type_error!(:float, value, context: context) unless value.is_a?(::Float) super end |