summaryrefslogtreecommitdiff
path: root/lib/algorithm.rb
blob: 530296aa9582f6a84d46fb2008f3f288e8c2dd00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module OpenTox

  # Wrapper for OpenTox Algorithms
  class Algorithm 

    # Execute algorithm with parameters, please consult the OpenTox API and the webservice documentation for acceptable parameters
    # @param [optional,Hash] params Algorithm parameters
    # @param [optional,Boolean] set to true if method should wait for task result
    # @return [String] URI of new resource (dataset, model, ...)
    def run params=nil, wait=true
      uri = RestClientWrapper.post @uri, params, { :content_type => "text/uri-list", :subjectid => @subjectid}
      wait_for_task uri if wait
    end
  end
end