class Bio::LITDB
LITDB class¶ ↑
Constants
- DELIMITER
Delimiter
- RS
Delimiter
- TAGSIZE
Public Class Methods
new(entry)
click to toggle source
Calls superclass method
Bio::NCBIDB.new
# File lib/bio/db/litdb.rb, line 27 def initialize(entry) super(entry, TAGSIZE) end
Public Instance Methods
entry_id()
click to toggle source
CODE
# File lib/bio/db/litdb.rb, line 51 def entry_id field_fetch('CODE') end
field()
click to toggle source
FIELD
# File lib/bio/db/litdb.rb, line 61 def field field_fetch('FIELD') end
journal()
click to toggle source
JOURNAL
# File lib/bio/db/litdb.rb, line 66 def journal field_fetch('JOURNAL') end
keyword()
click to toggle source
KEYWORD ';;'
# File lib/bio/db/litdb.rb, line 76 def keyword unless @data['KEYWORD'] @data['KEYWORD'] = fetch('KEYWORD').split(/;;\s*/) end @data['KEYWORD'] end
reference()
click to toggle source
Returns
# File lib/bio/db/litdb.rb, line 32 def reference hash = Hash.new('') hash['authors'] = author.split(/;/).map {|x| x.sub(/,/, ', ')} hash['title'] = title hash['journal'] = journal.gsub(/\./, '. ').strip vol = volume.split(/,\s+/) if vol.size > 1 hash['volume'] = vol.shift.sub(/Vol\./, '') hash['pages'], hash['year'] = vol.pop.split(' ') hash['issue'] = vol.shift.sub(/No\./, '') unless vol.empty? end return Reference.new(hash) end
title()
click to toggle source
TITLE
# File lib/bio/db/litdb.rb, line 56 def title field_fetch('TITLE') end
volume()
click to toggle source
VOLUME
# File lib/bio/db/litdb.rb, line 71 def volume field_fetch('VOLUME') end