From 6d88f38d61dbabd355a48e65bb49e94ba87a350c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 15 Feb 2012 22:53:14 +0000 Subject: empty subjectids fixed, adjustments for ree 1.8.7 --- lib/opentox.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/opentox.rb') diff --git a/lib/opentox.rb b/lib/opentox.rb index a9cbeab..51bc17a 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -154,7 +154,7 @@ module OpenTox def create service_uri, subjectid=nil uri = RestClient.post(service_uri, {}, :subjectid => subjectid).chomp - eval("#{self}.new(\"#{uri}\", #{subjectid})") + subjectid ? eval("#{self}.new(\"#{uri}\", #{subjectid})") : eval("#{self}.new(\"#{uri}\")") end def from_file service_uri, file, subjectid=nil @@ -163,7 +163,7 @@ module OpenTox def all service_uri, subjectid=nil uris = RestClient.get(service_uri, {:accept => 'text/uri-list'}).split("\n").compact - uris.collect{|uri| eval "#{self}.new(\"#{uri}\", #{subjectid})"} + uris.collect{|uri| subjectid ? eval("#{self}.new(\"#{uri}\", #{subjectid})") : eval("#{self}.new(\"#{uri}\")")} end end -- cgit v1.2.3