Class: PureForm::Types::DateType
Instance Method Summary
collapse
Methods inherited from BaseType
#initialize
Instance Method Details
#complex_typecast(year, month, day) ⇒ Object
10
11
12
13
14
|
# File 'lib/pure_form/types/date.rb', line 10
def complex_typecast(year, month, day)
Date.new(year, month, day)
rescue TypeError, ArgumentError
nil
end
|
#typecast(value) ⇒ Object
4
5
6
7
8
|
# File 'lib/pure_form/types/date.rb', line 4
def typecast(value)
value.to_date
rescue TypeError, ArgumentError, NoMethodError
nil
end
|