Class: DBF::ColumnType::Date
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from DBF::ColumnType::Base
Instance Method Details
#type_cast(value) ⇒ Object
76 77 78 79 80 |
# File 'lib/dbf/column_type.rb', line 76 def type_cast(value) value.match?(/\d{8}/) && ::Date.strptime(value, '%Y%m%d') rescue StandardError nil end |