From d6811507c1c1339cc4fe7cdb429b9b34b97dc422 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 22 Oct 2010 17:45:19 +0200 Subject: new API with support for external services (initial version) --- lib/model.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/model.rb') diff --git a/lib/model.rb b/lib/model.rb index 3ecd61c..d0d6703 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -84,8 +84,8 @@ module OpenTox def initialize @source = "http://github.com/helma/opentox-model" - @algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar") - #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative") + @algorithm = File.join(CONFIG[:services]["opentox-algorithm"],"lazar") + #@independent_variables = File.join(CONFIG[:services]["opentox-algorithm"],"fminer#BBRC_representative") @features = [] @effects = {} @activities = {} @@ -95,12 +95,12 @@ module OpenTox def save @features.uniq! - resource = RestClient::Resource.new(@@config[:services]["opentox-model"]) + resource = RestClient::Resource.new(CONFIG[:services]["opentox-model"]) resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s end def self.find_all - RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n") + RestClientWrapper.get(CONFIG[:services]["opentox-model"]).chomp.split("\n") end def self.predict(compound_uri,model_uri) @@ -115,8 +115,8 @@ module OpenTox def initialize @source = "http://github.com/helma/opentox-model" - @algorithm = File.join(@@config[:services]["opentox-algorithm"],"property_lazar") - #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative") + @algorithm = File.join(CONFIG[:services]["opentox-algorithm"],"property_lazar") + #@independent_variables = File.join(CONFIG[:services]["opentox-algorithm"],"fminer#BBRC_representative") @features = [] #@effects = {} @activities = {} @@ -126,12 +126,12 @@ module OpenTox def save @features.uniq! - resource = RestClient::Resource.new(@@config[:services]["opentox-model"]) + resource = RestClient::Resource.new(CONFIG[:services]["opentox-model"]) resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s end def self.find_all - RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n") + RestClientWrapper.get(CONFIG[:services]["opentox-model"]).chomp.split("\n") end def self.predict(compound_uri,model_uri) -- cgit v1.2.3