diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-03-14 11:44:53 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-03-14 11:44:53 +0000 |
commit | 1652bc3f3e635948fc3a73817f407adc6dee071a (patch) | |
tree | f62d525dae20a7e6178e259646cb5266450f4031 /lib/task.rb | |
parent | 99a1045502cabe4b39ebd1943bf46a7fcd42f128 (diff) |
metadata methods fixed
Diffstat (limited to 'lib/task.rb')
-rw-r--r-- | lib/task.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/task.rb b/lib/task.rb index be02deb..9921c4c 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -97,24 +97,10 @@ module OpenTox def method_missing(method,*args) method = method.to_s - begin - case method - when /=/ - res = RestClientWrapper.put(File.join(@uri,method.sub(/=/,'')),{}) - super unless res.code == 200 - else - pull - response = self.[](RDF::OT[method]) - response = self.[](RDF::OT1[method]) if response.empty? # API 1.1 compatibility - internal_server_error "No #{method} metadata for #{@uri} " if response.empty? - return response.uniq.first.to_s - end - rescue OpenTox::Error - raise $! - rescue - $logger.error "Unknown #{self.class} method #{method}" - super - end + response = self.[](RDF::OT[method]) + response = self.[](RDF::OT1[method]) if response.empty? # API 1.1 compatibility + internal_server_error "Unknown #{self.class} method #{method} for #{@uri}" if response.is_a? Array and response.empty? + return response.to_s end #TODO: subtasks |