Class: ValidateParams::Types::Integer
- Inherits:
-
Object
- Object
- ValidateParams::Types::Integer
- Defined in:
- lib/validate_params/types/integer.rb
Class Method Summary collapse
Class Method Details
.cast(raw_value) ⇒ Object
10 11 12 |
# File 'lib/validate_params/types/integer.rb', line 10 def self.cast(raw_value, **) raw_value.to_i end |
.valid?(value) ⇒ Boolean
6 7 8 |
# File 'lib/validate_params/types/integer.rb', line 6 def self.valid?(value) /\A[-+]?\d+\z/ === value.to_s end |