diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:27:39 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:27:39 +0100 |
commit | 2528891633d838a383f5a0e07712a0a8ee839f32 (patch) | |
tree | 6e221f6d0e18d280e8011c7dff16bc1e0581281a /lib/model.rb | |
parent | ddcf8597a13ea6f03c697c78d224376ff36c7ea3 (diff) | |
parent | dbd302164b74de2b241627bcc205de7245ea0da1 (diff) |
merged michas GET authorization
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/model.rb b/lib/model.rb index efa273b..85be1b5 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -88,15 +88,15 @@ module OpenTox # Get URIs of all lazar models # @return [Array] List of lazar model URIs - def self.all - RestClientWrapper.get(CONFIG[:services]["opentox-model"]).to_s.split("\n") + def self.all(subjectid=nil) + RestClientWrapper.get(CONFIG[:services]["opentox-model"], :subjectid => subjectid).to_s.split("\n") end # Find a lazar model # @param [String] uri Model URI # @return [OpenTox::Model::Lazar] lazar model - def self.find(uri) - YAML.load RestClientWrapper.get(uri,:accept => 'application/x-yaml') + def self.find(uri, subjectid=nil) + YAML.load RestClientWrapper.get(uri,{:accept => 'application/x-yaml', :subjectid => subjectid}) end # Create a new lazar model @@ -105,7 +105,7 @@ module OpenTox def self.create(params) lazar_algorithm = OpenTox::Algorithm::Generic.new File.join( CONFIG[:services]["opentox-algorithm"],"lazar") model_uri = lazar_algorithm.run(params) - OpenTox::Model::Lazar.find(model_uri) + OpenTox::Model::Lazar.find(model_uri, params[:subjectid]) end # Get a parameter value @@ -128,7 +128,7 @@ module OpenTox DC.title => URI.decode(File.basename( @metadata[OT.dependentVariables] )), OT.parameters => [{DC.title => "dataset_uri", OT.paramValue => dataset_uri}] }) - d = Dataset.new(dataset_uri) + d = Dataset.new(dataset_uri,subjectid) d.load_compounds count = 0 d.compounds.each do |compound_uri| |