summaryrefslogtreecommitdiff
path: root/lib/opentox.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-09-10 15:20:28 +0200
committerChristoph Helma <helma@in-silico.de>2009-09-10 15:20:28 +0200
commit285daeaafa3bdff027bc068be9a13232fca3e35d (patch)
treed1769b40c7bbf4738502ae947c41129e1a749af0 /lib/opentox.rb
parent6a2c3f2100d030c30b7d8ac8c95dcece7edb040c (diff)
Version bump to 1.0.0
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r--lib/opentox.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb
new file mode 100644
index 0000000..1a12123
--- /dev/null
+++ b/lib/opentox.rb
@@ -0,0 +1,28 @@
+module OpenTox
+
+ class OpenTox
+ attr_accessor :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
+