diff options
author | Christoph Helma <helma@in-silico.de> | 2010-01-22 11:16:13 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-01-22 11:16:13 +0100 |
commit | 09974c5a920bbb07475d8e48a725ef3780e60dbe (patch) | |
tree | e0992268d21f872eb554452da4a73d8d3acb9b2c /lib/model.rb | |
parent | c86df1faf22bcd90a8f318632c368d5ce474dbf8 (diff) |
central config.ru, generic compound API
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/model.rb b/lib/model.rb index 24f6e52..c4041f2 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -31,6 +31,12 @@ module OpenTox def self.find_all RestClient.get(@@config[:services]["opentox-model"]).split("\n") end + + def self.find(uri) + puts uri + yaml = RestClient.get(uri, :accept => "application/x-yaml") + OpenTox::Model::Lazar.from_yaml(yaml) + end # Predict a compound def predict(compound) @@ -46,7 +52,7 @@ module OpenTox end def endpoint - YAML.load(RestClient.get uri)[:endpoint] + YAML.load(RestClient.get(uri))[:endpoint] end def algorithm=(algorithm) |