Class: Bio::Ucsc::File::ByteQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-ucsc/file/bytequeue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#indexObject

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