Class: Biomart::Database
- Inherits:
-
Object
- Object
- Biomart::Database
- Includes:
- Biomart
- Defined in:
- lib/biomart/database.rb
Overview
Class representation for a biomart database. Will contain many Biomart::Dataset objects, and belong to a Biomart::Server.
Constant Summary
Constants included from Biomart
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#visible ⇒ Object
readonly
Returns the value of attribute visible.
Instance Method Summary collapse
-
#datasets ⇒ Hash
Returns a hash (keyed by the biomart ‘name’ for the dataset) of all of the Biomart::Dataset objects belonging to this server.
-
#initialize(url, args) ⇒ Database
constructor
A new instance of Database.
-
#list_datasets ⇒ Array
Returns an array of the dataset names (biomart ‘name’) for this dataset.
-
#visible? ⇒ Boolean
Returns true / false if this database is visbile in the default MartView interface.
Methods included from Biomart
Constructor Details
#initialize(url, args) ⇒ Database
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/biomart/database.rb', line 9 def initialize( url, args ) @url = url or raise ArgumentError, "must pass :url" unless @url =~ /martservice/ @url = @url + "/martservice" end @name = args["name"] || args[:name] @display_name = args["displayName"] || args[:display_name] @visible = ( args["visible"] || args[:visible] ) ? true : false @datasets = {} end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
7 8 9 |
# File 'lib/biomart/database.rb', line 7 def display_name @display_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/biomart/database.rb', line 7 def name @name end |
#visible ⇒ Object (readonly)
Returns the value of attribute visible.
7 8 9 |
# File 'lib/biomart/database.rb', line 7 def visible @visible end |
Instance Method Details
#datasets ⇒ Hash
Returns a hash (keyed by the biomart ‘name’ for the dataset) of all of the Biomart::Dataset objects belonging to this server.
36 37 38 39 40 41 |
# File 'lib/biomart/database.rb', line 36 def datasets if @datasets.empty? fetch_datasets end return @datasets end |
#list_datasets ⇒ Array
Returns an array of the dataset names (biomart ‘name’) for this dataset.
25 26 27 28 29 30 |
# File 'lib/biomart/database.rb', line 25 def list_datasets if @datasets.empty? fetch_datasets end return @datasets.keys end |
#visible? ⇒ Boolean
Returns true / false if this database is visbile in the default MartView interface.
47 48 49 |
# File 'lib/biomart/database.rb', line 47 def visible? @visible end |