Class: WeakParameters::IntegerValidator
- Inherits:
-
BaseValidator
- Object
- BaseValidator
- WeakParameters::IntegerValidator
- Defined in:
- lib/weak_parameters/integer_validator.rb
Instance Attribute Summary
Attributes inherited from BaseValidator
Instance Method Summary collapse
Methods inherited from BaseValidator
#initialize, #required?, #type, #validate
Constructor Details
This class inherits a constructor from WeakParameters::BaseValidator
Instance Method Details
#error_message ⇒ Object
7 8 9 |
# File 'lib/weak_parameters/integer_validator.rb', line 7 def "params[#{key.inspect}] must be an Integer" end |
#valid_type? ⇒ Boolean
3 4 5 |
# File 'lib/weak_parameters/integer_validator.rb', line 3 def valid_type? /\A-?\d+\z/ === value.to_s end |