diff options
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r-- | lib/dataset.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index 0a49e87..09616f8 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -78,7 +78,8 @@ module OpenTox end def self.create(data, content_type = 'application/rdf+xml') - uri = RestClient.post @@config[:services]["opentox-dataset"], data, :content_type => content_type + resource = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + uri = resource.post data, :content_type => content_type dataset = Dataset.new dataset.read uri.to_s dataset @@ -152,11 +153,12 @@ module OpenTox # Delete a dataset def delete - RestClient.delete @uri - end + resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + resource.delete + end def save - RestClient.post(@@config[:services]["opentox-dataset"], self.rdf, :content_type => "application/rdf+xml").to_s + RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(self.rdf, :content_type => "application/rdf+xml").to_s end def to_yaml |