Class: Pastore::Params::NumberValidation
- Inherits:
-
Validation
- Object
- Validation
- Pastore::Params::NumberValidation
- Defined in:
- lib/pastore/params/validations/number_validation.rb
Overview
Implements the validation logic for number parameters.
Instance Attribute Summary
Attributes inherited from Validation
Instance Method Summary collapse
-
#initialize(name, value, modifier, **options) ⇒ NumberValidation
constructor
A new instance of NumberValidation.
Methods inherited from Validation
#add_error, #required?, #valid?, validate!
Constructor Details
#initialize(name, value, modifier, **options) ⇒ NumberValidation
Returns a new instance of NumberValidation.
7 8 9 10 11 12 13 |
# File 'lib/pastore/params/validations/number_validation.rb', line 7 def initialize(name, value, modifier, **) @min = [:min] @max = [:max] @clamp = [:clamp] || [-Float::INFINITY, Float::INFINITY] super(name, 'number', value, modifier, **) end |