class Bio::DB

Public Class Methods

open(filename, *mode, &block) click to toggle source
# File lib/bio/db.rb, line 156
def, *mode, &block), filename, *mode, &block)

Public Instance Methods

entry_id() click to toggle source

Returns an entry identifier as a String. This method must be implemented in every database classes by overriding this method.

# File lib/bio/db.rb, line 162
def entry_id
  raise NotImplementedError
exists?(tag) click to toggle source

Returns true or false - wether the entry contains the field of the given tag name.

# File lib/bio/db.rb, line 173
def exists?(tag)
fetch(tag, skip = 0) click to toggle source

Similar to the get method, however, fetch returns the content of the field without its tag and any extra white spaces stripped.

# File lib/bio/db.rb, line 184
def fetch(tag, skip = 0)
  field = @orig[tag].split(/\n/, skip + 1).last.to_s
get(tag) click to toggle source

Returns an intact field of the tag as a String.

# File lib/bio/db.rb, line 178
def get(tag)
tags() click to toggle source

Returns a list of the top level tags of the entry as an Array of String.

# File lib/bio/db.rb, line 167
def tags