Class: DBF::ColumnType::Memo

Inherits:
Base
  • Object
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

#blank_value, #initialize, #skip_blank?

Constructor Details

This class inherits a constructor from DBF::ColumnType::Base

Instance Method Details

#decode(raw) ⇒ Object



127
128
129
130
# File 'lib/dbf/column_type.rb', line 127

def decode(raw, &)
  memo_content = yield(raw)
  memo_content ? type_cast(memo_content) : nil
end

#type_cast(value) ⇒ Object

Parameters:



133
134
135
136
137
# File 'lib/dbf/column_type.rb', line 133

def type_cast(value)
  return value unless encoding && value

  Encoder.encode(value.dup, encoding)
end