Class: DBF::ColumnType::Date
- Inherits:
-
Base
- Object
- Base
- DBF::ColumnType::Date
show all
- Defined in:
- lib/dbf/column_type.rb
Instance Attribute Summary
Attributes inherited from Base
#decimal, #encoding
Instance Method Summary
collapse
Methods inherited from Base
#decode, #initialize
Instance Method Details
#blank_value ⇒ Object
100
|
# File 'lib/dbf/column_type.rb', line 100
def blank_value = false
|
#skip_blank? ⇒ Boolean
99
|
# File 'lib/dbf/column_type.rb', line 99
def skip_blank? = true
|
#type_cast(value) ⇒ Object
103
104
105
106
107
|
# File 'lib/dbf/column_type.rb', line 103
def type_cast(value)
value.match?(/\d{8}/) && ::Date.strptime(value, '%Y%m%d')
rescue StandardError
nil
end
|