diff options
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/model.rb b/lib/model.rb index b86b3fc..6bdbfd2 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -34,7 +34,8 @@ module OpenTox # Predict a compound def predict(compound) - RestClient::Resource.new(@uri, :user => request.username, :password => request.password).post(:compound_uri => compound.uri) + resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + resource.post(:compound_uri => compound.uri) end def self.base_uri @@ -42,7 +43,8 @@ module OpenTox end def self.create(data) - RestClient::Resource.new(@@config[:services]["opentox-model"], :user => request.username, :password => request.password).post(data, :content_type => "application/x-yaml").to_s + resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + resource.post(data, :content_type => "application/x-yaml").to_s end def endpoint |