Class: OpenTox::ValidationReport
- Inherits:
-
Object
- Object
- OpenTox::ValidationReport
- Includes:
- OpenTox
- Defined in:
- lib/validation.rb
Instance Attribute Summary
Attributes included from OpenTox
Class Method Summary collapse
-
.create(validation_uri, params = {}, subjectid = nil, waiting_task = nil) ⇒ OpenTox::ValidationReport
creates a validation report via validation.
-
.find(uri, subjectid = nil) ⇒ OpenTox::ValidationReport
finds ValidationReport via uri, raises error if not found.
-
.find_for_validation(validation_uri, subjectid = nil) ⇒ OpenTox::ValidationReport
finds ValidationReport for a particular validation.
Methods included from OpenTox
#add_metadata, all, #delete, #initialize, #load_metadata, sign_in, text_to_html, #to_rdfxml
Class Method Details
.create(validation_uri, params = {}, subjectid = nil, waiting_task = nil) ⇒ OpenTox::ValidationReport
creates a validation report via validation
239 240 241 242 243 244 245 246 247 |
# File 'lib/validation.rb', line 239 def self.create( validation_uri, params={}, subjectid=nil, waiting_task=nil ) params = {} if params==nil raise OpenTox::BadRequestError.new "params is no hash" unless params.is_a?(Hash) params[:validation_uris] = validation_uri params[:subjectid] = subjectid uri = RestClientWrapper.post(File.join(CONFIG[:services]["opentox-validation"],"/report/validation"), params, {}, waiting_task ) ValidationReport.new(uri) end |
.find(uri, subjectid = nil) ⇒ OpenTox::ValidationReport
finds ValidationReport via uri, raises error if not found
215 216 217 218 219 220 |
# File 'lib/validation.rb', line 215 def self.find( uri, subjectid=nil ) OpenTox::RestClientWrapper.get(uri,{:subjectid => subjectid}) rep = ValidationReport.new(uri) rep.( subjectid ) rep end |
.find_for_validation(validation_uri, subjectid = nil) ⇒ OpenTox::ValidationReport
finds ValidationReport for a particular validation
226 227 228 229 230 |
# File 'lib/validation.rb', line 226 def self.find_for_validation( validation_uri, subjectid=nil ) uris = RestClientWrapper.get(File.join(CONFIG[:services]["opentox-validation"], "/report/validation?validation="+validation_uri), {:subjectid => subjectid}).chomp.split("\n") uris.size==0 ? nil : ValidationReport.new(uris[-1]) end |