summaryrefslogtreecommitdiff
path: root/lib/opentox-ruby-api-wrapper.rb
blob: e504e659b9b5425a2b166bd13936d46f737f0a2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#['rubygems', 'sinatra', 'sinatra/respond_to', 'sinatra/url_for', 'builder', 'rest_client', 'yaml', 'spork', 'environment', 'openbabel', 'httpclient'].each do |lib|
['rubygems', 'sinatra', 'sinatra/url_for', 'builder', 'rest_client', 'yaml', 'spork', 'environment', 'openbabel', 'httpclient'].each do |lib|
	require lib
end

module OpenTox

	class OpenTox
		attr_reader :uri

		def initialize(uri)
			@uri = uri
		end

		# Get the object name
		def name
			RestClient.get @uri + '/name'
		end

		# Deletes an object
		def destroy
			RestClient.delete @uri
		end

		# Object path without hostname
		def path
			URI.split(@uri)[5]
		end

	end

end

['compound','feature','dataset','algorithm','model','utils'].each do |lib|
	require lib
end