diff options
author | rautenberg <rautenberg@in-silico.ch> | 2013-02-07 11:55:58 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2013-02-07 11:55:58 +0100 |
commit | 2d7909789e3a4ee3c669125fb1f09fe3b4577de8 (patch) | |
tree | c5b448618d69e8c13b12aa9f0b9588a93c3cfe02 /lib/utils/shims/task.rb | |
parent | f1a6d9f9d5bc73d757e0864d998c95f10ebeecbb (diff) | |
parent | cadc92f526a04dd270134bade08d053f4b099923 (diff) |
Merge branch 'development' of github.com:opentox/opentox-client into development
Diffstat (limited to 'lib/utils/shims/task.rb')
-rw-r--r-- | lib/utils/shims/task.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/utils/shims/task.rb b/lib/utils/shims/task.rb index cb73e72..7ac8a7d 100644 --- a/lib/utils/shims/task.rb +++ b/lib/utils/shims/task.rb @@ -11,12 +11,52 @@ module OpenTox # Shims for the Task class class Task + def self.run(description, creator, subjectid=nil) + create($task[:uri],subjectid,{ RDF::DC.description => description, RDF::DC.creator => creator},&Proc.new) + end + # Check status of a task # @return [String] Status def status self[RDF::OT.hasStatus] end + + def code + RestClientWrapper.head(@uri).code + end end end + + +module OpenTox + + class SubTask + + def initialize(task, min, max) + #TODO add subtask code + end + + def self.create(task, min, max) + if task + SubTask.new(task, min, max) + else + nil + end + end + + def waiting_for(task_uri) + #TODO add subtask code + end + + def progress(pct) + #TODO add subtask code + end + + def running?() + #TODO add subtask code + end + end + +end
\ No newline at end of file |