Class: Valigator::CSV::FieldValidators::Date
- Inherits:
-
Base
- Object
- Base
- Valigator::CSV::FieldValidators::Date
show all
- Defined in:
- lib/valigator/csv/field_validators/date.rb
Instance Attribute Summary
Attributes inherited from Base
#options
Instance Method Summary
collapse
Methods inherited from Base
#==, #initialize
Instance Method Details
#error_message ⇒ Object
23
24
25
|
# File 'lib/valigator/csv/field_validators/date.rb', line 23
def error_message
'Invalid date field'
end
|
#error_type ⇒ Object
17
18
19
|
# File 'lib/valigator/csv/field_validators/date.rb', line 17
def error_type
'invalid_date'
end
|
#valid?(value) ⇒ Boolean
6
7
8
9
10
11
12
13
|
# File 'lib/valigator/csv/field_validators/date.rb', line 6
def valid?(value)
return true if allow_blank and blank? value
parse value
true
rescue ArgumentError
false
end
|