Module: Bio::UniChem::REST::UniChem_URI
- Defined in:
- lib/bio-unichem/unichem.rb
Overview
Generate URIs for UniChem REST Web service Bio::UniChem::REST::UniChem_URI
Class Method Summary collapse
- .address(path) ⇒ Object
- .inchikey(inchikey) ⇒ Object
- .inchikey_all(inchikey) ⇒ Object
-
.mapping(src_id, to_src_id) ⇒ Object
Example: www.ebi.ac.uk/unichem/rest/mapping/4/1.
-
.sources(src_id) ⇒ Object
Example: www.ebi.ac.uk/unichem/rest/sources/1.
- .src_compound_id(src_compound_id, src_id, to_src_id = nil) ⇒ Object
- .src_compound_id_all(src_compound_id, src_id, to_src_id = nil) ⇒ Object
- .src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil) ⇒ Object
- .src_compound_id_url(src_compound_id, src_id, to_src_id) ⇒ Object
-
.src_ids ⇒ Object
Example: www.ebi.ac.uk/unichem/rest/src_ids/.
- .structure(src_compound_id, src_id) ⇒ Object
- .structure_all(src_compound_id, src_id) ⇒ Object
- .verbose_inchikey(inchikey) ⇒ Object
Class Method Details
.address(path) ⇒ Object
25 26 27 |
# File 'lib/bio-unichem/unichem.rb', line 25 def self.address(path) "#{BASE_URL}/#{path}" end |
.inchikey(inchikey) ⇒ Object
49 50 51 |
# File 'lib/bio-unichem/unichem.rb', line 49 def self.inchikey(inchikey) address("inchikey/#{inchikey}") end |
.inchikey_all(inchikey) ⇒ Object
54 55 56 |
# File 'lib/bio-unichem/unichem.rb', line 54 def self.inchikey_all(inchikey) address("inchikey_all/#{inchikey}") end |
.mapping(src_id, to_src_id) ⇒ Object
44 45 46 |
# File 'lib/bio-unichem/unichem.rb', line 44 def self.mapping(src_id, to_src_id) address("mapping/#{src_id}/#{to_src_id}") end |
.sources(src_id) ⇒ Object
Example: www.ebi.ac.uk/unichem/rest/sources/1
64 65 66 |
# File 'lib/bio-unichem/unichem.rb', line 64 def self.sources(src_id) address("sources/#{src_id}") end |
.src_compound_id(src_compound_id, src_id, to_src_id = nil) ⇒ Object
31 32 33 34 |
# File 'lib/bio-unichem/unichem.rb', line 31 def self.src_compound_id(src_compound_id, src_id, to_src_id = nil) path = [src_compound_id, src_id, to_src_id].compact.join("/") address("src_compound_id/#{path}") end |
.src_compound_id_all(src_compound_id, src_id, to_src_id = nil) ⇒ Object
38 39 40 41 |
# File 'lib/bio-unichem/unichem.rb', line 38 def self.src_compound_id_all(src_compound_id, src_id, to_src_id = nil) path = [src_compound_id, src_id, to_src_id].compact.join("/") address("src_compound_id_all/#{path}") end |
.src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil) ⇒ Object
85 86 87 88 |
# File 'lib/bio-unichem/unichem.rb', line 85 def self.src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil) path = [src_compound_id, src_id, to_src_id].compact.join("/") address("src_compound_id_all_obsolete/#{path}") end |
.src_compound_id_url(src_compound_id, src_id, to_src_id) ⇒ Object
79 80 81 |
# File 'lib/bio-unichem/unichem.rb', line 79 def self.src_compound_id_url(src_compound_id, src_id, to_src_id) address("src_compound_id_url/#{src_compound_id}/#{src_id}/#{to_src_id}") end |
.src_ids ⇒ Object
Example: www.ebi.ac.uk/unichem/rest/src_ids/
59 60 61 |
# File 'lib/bio-unichem/unichem.rb', line 59 def self.src_ids address("src_ids/") end |
.structure(src_compound_id, src_id) ⇒ Object
69 70 71 |
# File 'lib/bio-unichem/unichem.rb', line 69 def self.structure(src_compound_id, src_id) address("structure/#{src_compound_id}/#{src_id}") end |
.structure_all(src_compound_id, src_id) ⇒ Object
74 75 76 |
# File 'lib/bio-unichem/unichem.rb', line 74 def self.structure_all(src_compound_id, src_id) address("structure_all/#{src_compound_id}/#{src_id}") end |
.verbose_inchikey(inchikey) ⇒ Object
91 92 93 |
# File 'lib/bio-unichem/unichem.rb', line 91 def self.verbose_inchikey(inchikey) address("verbose_inchikey/#{inchikey}") end |