class Bio::GFFbrowser::Digest::LruCacheHelpers::SeekRecList
Helper class which gives Hash-like access to the no-cache GFF3
file
Public Class Methods
new(fh, parser, lru)
click to toggle source
# File lib/bio/db/gff/digest/gfflrucache.rb, line 58 def initialize fh, parser, lru @fh = fh @h = {} @parser = parser @lru = lru end
Public Instance Methods
[](id)
click to toggle source
# File lib/bio/db/gff/digest/gfflrucache.rb, line 71 def [](id) fpos = @h[id] fetch(@fh,fpos,@parser) end
[]=(id, rec)
click to toggle source
# File lib/bio/db/gff/digest/gfflrucache.rb, line 65 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/gfflrucache.rb, line 76 def each @h.each do | id,fpos | yield id, self[id] end end