Class: DBF::ColumnType::String
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #blank_value ⇒ Object
-
#initialize(column) ⇒ String
constructor
A new instance of String.
- #skip_blank? ⇒ Boolean
- #type_cast(value) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(column) ⇒ String
Returns a new instance of String.
143 144 145 146 147 |
# File 'lib/dbf/column_type.rb', line 143 def initialize(column) super @target_encoding = Encoding.default_external @needs_encode = encoding && encoding != @target_encoding end |
Instance Method Details
#blank_value ⇒ Object
150 |
# File 'lib/dbf/column_type.rb', line 150 def blank_value = '' |
#type_cast(value) ⇒ Object
153 154 155 156 |
# File 'lib/dbf/column_type.rb', line 153 def type_cast(value) value.strip! encoding ? encode(value) : value end |