Class: DBF::Memo::Dbase3

Inherits:
Base
  • Object
show all
Defined in:
lib/dbf/memo/dbase3.rb

Constant Summary

Constants inherited from Base

Base::BLOCK_HEADER_SIZE, Base::BLOCK_SIZE

Instance Method Summary collapse

Methods inherited from Base

#close, #closed?, #get, #initialize, open

Constructor Details

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

Instance Method Details

#build_memo(start_block) ⇒ Object

:nodoc:



4
5
6
7
8
9
10
11
12
13
# File 'lib/dbf/memo/dbase3.rb', line 4

def build_memo(start_block) # :nodoc:
  @data.seek offset(start_block)
  memo_string = ''
  loop do
    block = @data.read(BLOCK_SIZE).gsub(/(\000|\032)/, '')
    memo_string << block
    break if block.size < BLOCK_SIZE
  end
  memo_string
end