Class: Bio::Ucsc::File::ByteQueue
- Inherits:
-
Object
- Object
- Bio::Ucsc::File::ByteQueue
- Defined in:
- lib/bio-ucsc/file/bytequeue.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(str) ⇒ ByteQueue
constructor
A new instance of ByteQueue.
- #next(n) ⇒ Object
Constructor Details
#initialize(str) ⇒ ByteQueue
Returns a new instance of ByteQueue.
13 14 15 16 |
# File 'lib/bio-ucsc/file/bytequeue.rb', line 13 def initialize(str) @str = str @index = 0 end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
18 19 20 |
# File 'lib/bio-ucsc/file/bytequeue.rb', line 18 def index @index end |
Instance Method Details
#next(n) ⇒ Object
20 21 22 23 24 |
# File 'lib/bio-ucsc/file/bytequeue.rb', line 20 def next(n) result = @str[@index, n] @index += n result end |