Module: OpenTox::Model
Defined Under Namespace
Instance Attribute Summary
Attributes included from OpenTox
Instance Method Summary collapse
-
#run(params, accept_header = nil, waiting_task = nil) ⇒ text/uri-list
Run a model with parameters.
Methods included from OpenTox
#add_metadata, all, #delete, #initialize, #load_metadata, sign_in, text_to_html, #to_rdfxml
Instance Method Details
#run(params, accept_header = nil, waiting_task = nil) ⇒ text/uri-list
Run a model with parameters
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/model.rb', line 11 def run( params, accept_header=nil, waiting_task=nil ) unless accept_header if CONFIG[:json_hosts].include?(URI.parse(@uri).host) accept_header = 'application/json' else accept_header = 'application/rdf+xml' end end LOGGER.info "running model "+@uri.to_s+", params: "+params.inspect+", accept: "+accept_header.to_s RestClientWrapper.post(@uri,params,{:accept => accept_header},waiting_task).to_s end |