Module: Bio::GFFbrowser::Digest::LruCacheHelpers::LruRec
- Included in:
- SeekRecList
- Defined in:
- lib/bio/db/gff/digest/gfflrucache.rb
Instance Method Summary collapse
-
#fetch(fh, fpos, parser) ⇒ Object
Fetch a record using fh and file seek position, utilising the LRU cache.
Instance Method Details
#fetch(fh, fpos, parser) ⇒ Object
Fetch a record using fh and file seek position, utilising the LRU cache
42 43 44 45 46 47 48 49 50 |
# File 'lib/bio/db/gff/digest/gfflrucache.rb', line 42 def fetch(fh,fpos,parser) return nil if fh==nil or fpos==nil rec = @lru[fpos] if rec==nil rec = SeekRec::fetch(fh,fpos,parser) @lru[fpos] = rec end rec end |