Class: DBF::Memo::Base
- Inherits:
-
Object
- Object
- DBF::Memo::Base
- Defined in:
- lib/dbf/memo/base.rb
Constant Summary collapse
- BLOCK_HEADER_SIZE =
8- BLOCK_SIZE =
512
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
- #get(start_block) ⇒ Object
-
#initialize(data, version) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(data, version) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/dbf/memo/base.rb', line 13 def initialize(data, version) @data = data @version = version end |
Class Method Details
.open(filename, version) ⇒ Object
9 10 11 |
# File 'lib/dbf/memo/base.rb', line 9 def self.open(filename, version) new(File.open(filename, 'rb'), version) end |
Instance Method Details
#close ⇒ Object
24 25 26 |
# File 'lib/dbf/memo/base.rb', line 24 def close @data.close && @data.closed? end |
#closed? ⇒ Boolean
28 29 30 |
# File 'lib/dbf/memo/base.rb', line 28 def closed? @data.closed? end |
#get(start_block) ⇒ Object
18 19 20 21 22 |
# File 'lib/dbf/memo/base.rb', line 18 def get(start_block) return nil unless start_block > 0 build_memo start_block end |