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
byte length of the record.
-
#index ⇒ Object
readonly
zero based.
-
#offset ⇒ Object
readonly
byte offset in the IO stream.
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
13 14 15 16 17 |
# File 'lib/flat_kit/position.rb', line 13 def initialize(index: nil, offset: nil, bytesize: nil) @index = index @offset = offset @bytesize = bytesize end |
Instance Attribute Details
#bytesize ⇒ Object (readonly)
byte length of the record
11 12 13 |
# File 'lib/flat_kit/position.rb', line 11 def bytesize @bytesize end |
#index ⇒ Object (readonly)
zero based
9 10 11 |
# File 'lib/flat_kit/position.rb', line 9 def index @index end |
#offset ⇒ Object (readonly)
byte offset in the IO stream
10 11 12 |
# File 'lib/flat_kit/position.rb', line 10 def offset @offset end |