class Valigator::CSV::FieldValidators::Integer

Public Instance Methods

error_message() click to toggle source
# File lib/valigator/csv/field_validators/integer.rb, line 20
def error_message
  'Invalid integer field'
end
error_type() click to toggle source
# File lib/valigator/csv/field_validators/integer.rb, line 14
def error_type
  'invalid_integer'
end
valid?(value) click to toggle source
# File lib/valigator/csv/field_validators/integer.rb, line 6
def valid?(value)
  return true if allow_blank and blank? value

  value.is_a?(::Integer) || value.to_i.to_s == value.to_s
end