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
27 def initialize(entry)
28   super(entry, TAGSIZE)
29 end

Public Instance Methods

author() click to toggle source

AUTHOR

   # File lib/bio/db/litdb.rb
84 def author
85   field_fetch('AUTHOR')
86 end
entry_id() click to toggle source

CODE

   # File lib/bio/db/litdb.rb
51 def entry_id
52   field_fetch('CODE')
53 end
field() click to toggle source

FIELD

   # File lib/bio/db/litdb.rb
61 def field
62   field_fetch('FIELD')
63 end
journal() click to toggle source

JOURNAL

   # File lib/bio/db/litdb.rb
66 def journal
67   field_fetch('JOURNAL')
68 end
keyword() click to toggle source

KEYWORD ‘;;’

   # File lib/bio/db/litdb.rb
76 def keyword
77   unless @data['KEYWORD']
78     @data['KEYWORD'] = fetch('KEYWORD').split(/;;\s*/)
79   end
80   @data['KEYWORD']
81 end
reference() click to toggle source

Returns

   # File lib/bio/db/litdb.rb
32 def reference
33   hash = Hash.new('') 
34 
35   hash['authors'] = author.split(/;/).map {|x| x.sub(/,/, ', ')}
36   hash['title']   = title 
37   hash['journal'] = journal.gsub(/\./, '. ').strip
38 
39   vol = volume.split(/,\s+/)
40   if vol.size > 1
41     hash['volume'] = vol.shift.sub(/Vol\./, '')
42     hash['pages'],
43     hash['year'] = vol.pop.split(' ')
44     hash['issue'] = vol.shift.sub(/No\./, '') unless vol.empty?
45   end
46 
47   return Reference.new(hash) 
48 end
title() click to toggle source

TITLE

   # File lib/bio/db/litdb.rb
56 def title
57   field_fetch('TITLE')
58 end
volume() click to toggle source

VOLUME

   # File lib/bio/db/litdb.rb
71 def volume
72   field_fetch('VOLUME')
73 end