class Bio::DB
Public Class Methods
Source
# File lib/bio/db.rb 157 def self.open(filename, *mode, &block) 158 Bio::FlatFile.open(self, filename, *mode, &block) 159 end
Public Instance Methods
Source
# File lib/bio/db.rb 163 def entry_id 164 raise NotImplementedError 165 end
Returns an entry identifier as a String. This method must be implemented in every database classes by overriding this method.
Source
# File lib/bio/db.rb 174 def exists?(tag) 175 @orig.include?(tag) 176 end
Returns true or false - wether the entry contains the field of the given tag name.
Source
# File lib/bio/db.rb 185 def fetch(tag, skip = 0) 186 field = @orig[tag].split(/\n/, skip + 1).last.to_s 187 truncate(field.gsub(/^.{0,#{@tagsize}}/,'')) 188 end
Similar to the get method, however, fetch returns the content of the field without its tag and any extra white spaces stripped.
Source
# File lib/bio/db.rb 179 def get(tag) 180 @orig[tag] 181 end
Returns an intact field of the tag as a String.