Class Ensembl::Core::ExternalDb
In: lib/ensembl/core/activerecord.rb
Parent: DBConnection

DESCRIPTION

The ExternalDb class provides an interface to the external_db table. This table contains references to databases to which xrefs can point to

This class uses ActiveRecord to access data in the Ensembl database. See the general documentation of the Ensembl module for more information on what this means and what methods are available.

USAGE

 embl_db = ExternalDb.find_by_db_name('EMBL')
 puts embl_db.xrefs.length.to_s

Methods

Public Class methods

DESCRIPTION

The ExternalDb#find_all_by_display_label method returns all external databases that have this label. There should normally be no more than one. If no databases are found with this name, this method returns an empty array.

[Source]

      # File lib/ensembl/core/activerecord.rb, line 1566
1566:       def self.find_all_by_display_label(label)
1567:         answer = Array.new
1568:         xrefs = Xref.find_all_by_display_label(label)
1569:         xrefs.each do |xref|
1570:           answer.push(self.class.find_by_xref_id(xref.xref_id))
1571:         end
1572: 
1573:         return answer
1574:       end

DESCRIPTION

The ExternalDb#find_by_display_label method returns a database that has this label. If no databases are found with this name, this method returns nil. empty array.

[Source]

      # File lib/ensembl/core/activerecord.rb, line 1581
1581:       def self.find_by_display_label(label)
1582:         all_dbs = self.find_all_by_display_label(label)
1583:         if all_dbs.length == 0
1584:           return nil
1585:         else
1586:           return all_dbs[0]
1587:         end
1588:       end

[Source]

      # File lib/ensembl/core/activerecord.rb, line 1557
1557:       def self.inheritance_column
1558:         nil
1559:       end

[Validate]