class Bio::GFFbrowser::Digest::NoCacheHelpers::SeekRecList

Helper class which gives Hash-like access to the no-cache GFF3 file

Public Class Methods

new(fh, parser) click to toggle source
# File lib/bio/db/gff/digest/gffnocache.rb, line 38
def initialize fh, parser
  @fh = fh
  @h = {}
  @parser = parser
end

Public Instance Methods

[](id) click to toggle source
# File lib/bio/db/gff/digest/gffnocache.rb, line 50
def [](id)
  fpos = @h[id]
  SeekRec::fetch(@fh,fpos,@parser)
end
[]=(id, rec) click to toggle source
# File lib/bio/db/gff/digest/gffnocache.rb, line 44
def []= id, rec
  raise "id #{id} occurs twice!" if @h[id]
  fpos = rec.io_seek
  @h[id] = fpos
end
each() { |id, self| ... } click to toggle source
# File lib/bio/db/gff/digest/gffnocache.rb, line 55
def each 
  @h.each do | id,fpos |
    yield id, self[id]
  end
end