Class: Biomart::Server
- Inherits:
-
Object
- Object
- Biomart::Server
- Includes:
- Biomart
- Defined in:
- lib/biomart/server.rb
Overview
Class representation for a biomart server. Will contain many Biomart::Database and Biomart::Dataset objects.
Constant Summary
Constants included from Biomart
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#databases ⇒ Object
Returns a hash (keyed by the biomart ‘name’ for the database) of all of the Biomart::Database objects belonging to this server.
-
#datasets ⇒ Object
Returns a hash (keyed by the biomart ‘name’ for the dataset) of all of the Biomart::Dataset objects belonging to this server.
-
#initialize(url) ⇒ Server
constructor
A new instance of Server.
-
#list_databases ⇒ Object
Returns an array of the database names (biomart ‘name’) for this dataset.
-
#list_datasets ⇒ Object
Returns an array of the dataset names (biomart ‘name’) for this dataset.
Methods included from Biomart
Constructor Details
#initialize(url) ⇒ Server
Returns a new instance of Server.
9 10 11 12 13 14 15 16 17 |
# File 'lib/biomart/server.rb', line 9 def initialize( url ) @url = url or raise ArgumentError, "must pass :url" unless @url =~ /martservice/ @url = @url + "/martservice" end @databases = {} @datasets = {} end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/biomart/server.rb', line 7 def url @url end |
Instance Method Details
#databases ⇒ Object
Returns a hash (keyed by the biomart ‘name’ for the database) of all of the Biomart::Database objects belonging to this server.
30 31 32 33 34 35 |
# File 'lib/biomart/server.rb', line 30 def databases if @databases.empty? fetch_databases end return @databases end |
#datasets ⇒ Object
Returns a hash (keyed by the biomart ‘name’ for the dataset) of all of the Biomart::Dataset objects belonging to this server.
48 49 50 51 52 53 |
# File 'lib/biomart/server.rb', line 48 def datasets if @datasets.empty? fetch_datasets end return @datasets end |
#list_databases ⇒ Object
Returns an array of the database names (biomart ‘name’) for this dataset.
21 22 23 24 25 26 |
# File 'lib/biomart/server.rb', line 21 def list_databases if @databases.empty? fetch_databases end return @databases.keys end |
#list_datasets ⇒ Object
Returns an array of the dataset names (biomart ‘name’) for this dataset.
39 40 41 42 43 44 |
# File 'lib/biomart/server.rb', line 39 def list_datasets if @datasets.empty? fetch_datasets end return @datasets.keys end |