summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2010-02-01 14:50:10 +0100
committermr <mr@mrautenberg.de>2010-02-01 14:50:10 +0100
commite0b1279e10451294662bdd19b11568c39128bdc3 (patch)
tree96ca071bdb64cf338a9b23eb962497093be5d7c7 /lib/model.rb
parent492f73257e6c87d84e4b25c49e4a392859d59b1c (diff)
parent3925785d70b541345bdbbbad7a8fce18eeaa01db (diff)
delete lib/templates/config.ru
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 6bdbfd2..d732aa4 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -31,6 +31,11 @@ module OpenTox
def self.find_all
RestClient.get(@@config[:services]["opentox-model"]).split("\n")
end
+
+ def self.find(uri)
+ yaml = RestClient.get(uri, :accept => "application/x-yaml")
+ OpenTox::Model::Lazar.from_yaml(yaml)
+ end
# Predict a compound
def predict(compound)
@@ -48,7 +53,7 @@ module OpenTox
end
def endpoint
- YAML.load(RestClient.get uri)[:endpoint]
+ YAML.load(RestClient.get(uri))[:endpoint]
end
def algorithm=(algorithm)