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.
148 149 150 151 152 |
# File 'lib/dbf/column_type.rb', line 148 def initialize(column) super @target_encoding = Encoding.default_external @needs_encode = encoding && encoding != @target_encoding end |
Instance Method Details
#blank_value ⇒ Object
155 |
# File 'lib/dbf/column_type.rb', line 155 def blank_value = '' |
#type_cast(value) ⇒ Object
158 159 160 161 |
# File 'lib/dbf/column_type.rb', line 158 def type_cast(value) value.strip! encoding ? encode(value) : value end |