Class: FlatKit::Position
- Inherits:
-
Object
- Object
- FlatKit::Position
- Defined in:
- lib/flat_kit/position.rb
Overview
The information about the position of a record in an IO stream
Generally this is going to be returned by a write_record method to return information about the record that was just written
Instance Attribute Summary collapse
-
#bytesize ⇒ Object
readonly
zero based # byte offset in the IO stream # byte length of the record.
-
#index ⇒ Object
readonly
zero based # byte offset in the IO stream # byte length of the record.
-
#offset ⇒ Object
readonly
zero based # byte offset in the IO stream # byte length of the record.
Instance Method Summary collapse
-
#initialize(index: nil, offset: nil, bytesize: nil) ⇒ Position
constructor
A new instance of Position.
Constructor Details
#initialize(index: nil, offset: nil, bytesize: nil) ⇒ Position
Returns a new instance of Position.
12 13 14 15 16 |
# File 'lib/flat_kit/position.rb', line 12 def initialize(index: nil, offset: nil, bytesize: nil) @index = index @offset = offset @bytesize = bytesize end |
Instance Attribute Details
#bytesize ⇒ Object (readonly)
zero based # byte offset in the IO stream # byte length of the record
10 11 12 |
# File 'lib/flat_kit/position.rb', line 10 def bytesize @bytesize end |
#index ⇒ Object (readonly)
zero based # byte offset in the IO stream # byte length of the record
10 11 12 |
# File 'lib/flat_kit/position.rb', line 10 def index @index end |
#offset ⇒ Object (readonly)
zero based # byte offset in the IO stream # byte length of the record
10 11 12 |
# File 'lib/flat_kit/position.rb', line 10 def offset @offset end |