Class: MartSearch::DummyDataSource
- Inherits:
-
DataSource
- Object
- DataSource
- MartSearch::DummyDataSource
- Defined in:
- lib/martsearch/data_source_dummy.rb
Overview
Custom DataSource class for reading files off the local filesystem.
Instance Method Summary (collapse)
-
- (Object) data_origin_url(query, conf)
Function to provide a link URL to the original datasource given a dataset query.
-
- (Object) fetch_all_terms_for_indexing(conf)
Function to query a biomart datasource and return all of the data ready for indexing.
-
- (Boolean) is_alive?
Simple heartbeat function to check that the datasource is online.
-
- (Object) search(query, conf)
Function to search a biomart datasource given an appropriate configuration.
Methods inherited from DataSource
Methods included from Utils
#build_http_client, #convert_array_to_hash
Constructor Details
This class inherits a constructor from MartSearch::DataSource
Instance Method Details
- (Object) data_origin_url(query, conf)
Function to provide a link URL to the original datasource given a dataset query.
41 42 43 |
# File 'lib/martsearch/data_source_dummy.rb', line 41 def data_origin_url( query, conf ) nil end |
- (Object) fetch_all_terms_for_indexing(conf)
Function to query a biomart datasource and return all of the data ready for indexing.
- THIS FEATURE HAS NOT BEEN IMPLEMENTED FOR THIS CLASS.
21 22 23 |
# File 'lib/martsearch/data_source_dummy.rb', line 21 def fetch_all_terms_for_indexing( conf ) raise NotImplementedError, "This feature has not been implemented for the DummyDataSource class." end |
- (Boolean) is_alive?
Simple heartbeat function to check that the datasource is online.
12 13 14 |
# File 'lib/martsearch/data_source_dummy.rb', line 12 def is_alive? true end |
- (Object) search(query, conf)
Function to search a biomart datasource given an appropriate configuration.
29 30 31 32 33 34 35 |
# File 'lib/martsearch/data_source_dummy.rb', line 29 def search( query, conf ) return_obj = [] query.each do |term| return_obj.push({ :mgi_accession_id => term }) end return return_obj end |