Class: Bioroebe::Biomart::Database

Inherits:
Object
  • Object
show all
Includes:
Bioroebe::Biomart
Defined in:
lib/bioroebe/biomart/database.rb

Overview

Bioroebe::Biomart::Dataset

Instance Method Summary collapse

Methods included from Bioroebe::Biomart

#request

Constructor Details

#initialize(url, args) ⇒ Database

#

initialize

#


23
24
25
26
27
28
29
30
31
32
# File 'lib/bioroebe/biomart/database.rb', line 23

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
  reset
end

Instance Method Details

#datasets?Hash Also known as: datasets

#

datasets?

Returns a hash (keyed by the biomart ‘name’ for the dataset) of all of the Biomart::Dataset objects belonging to this server.

#

Returns:

  • (Hash)

    A hash of Biomart::Dataset objects keyed by ‘name’



78
79
80
81
82
83
# File 'lib/bioroebe/biomart/database.rb', line 78

def datasets?
  if @datasets.empty?
    fetch_datasets
  end
  return @datasets
end

#display_name?Boolean Also known as: display_name

#

display_name?

#

Returns:

  • (Boolean)


124
125
126
# File 'lib/bioroebe/biomart/database.rb', line 124

def display_name?
  @display_name
end

#list_datasetsArray

#

list_datasets

Returns an array of the dataset names (biomart ‘name’) for this dataset.

#

Returns:

  • (Array)

    An array of dataset names.



56
57
58
59
60
61
# File 'lib/bioroebe/biomart/database.rb', line 56

def list_datasets
  if @datasets.empty?
    fetch_datasets
  end
  return @datasets.keys
end

#name?Boolean Also known as: name

#

name?

#

Returns:

  • (Boolean)


66
67
68
# File 'lib/bioroebe/biomart/database.rb', line 66

def name?
  @name
end

#resetObject

#

reset

#


37
38
39
# File 'lib/bioroebe/biomart/database.rb', line 37

def reset
  @datasets = {}
end

#visibleBoolean

#

visible?

#

visible

Returns:

  • (Boolean)


46
47
48
# File 'lib/bioroebe/biomart/database.rb', line 46

def visible?
  @visible
end

#visible?Boolean

#

visible?

Returns true / false if this database is visbile in the default MartView interface.

#

Returns:

  • (Boolean)

    true/false



44
45
46
# File 'lib/bioroebe/biomart/database.rb', line 44

def visible?
  @visible
end