diff options
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r-- | lib/opentox.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |