Class: Valigator::CSV::FieldValidators::Float
- Inherits:
-
Integer
- Object
- Base
- Integer
- Valigator::CSV::FieldValidators::Float
show all
- Defined in:
- lib/valigator/csv/field_validators/float.rb
Instance Attribute Summary
Attributes inherited from Base
#options
Instance Method Summary
collapse
Methods inherited from Base
#==, #initialize
Instance Method Details
#error_message ⇒ Object
18
19
20
|
# File 'lib/valigator/csv/field_validators/float.rb', line 18
def error_message
'Invalid float field'
end
|
#error_type ⇒ Object
12
13
14
|
# File 'lib/valigator/csv/field_validators/float.rb', line 12
def error_type
'invalid_float'
end
|
#valid?(value) ⇒ Boolean
6
7
8
|
# File 'lib/valigator/csv/field_validators/float.rb', line 6
def valid?(value)
super || value.is_a?(::Float) || formatted_float?(value)
end
|