summaryrefslogtreecommitdiff
path: root/lib/utils/shims/task.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/shims/task.rb')
-rw-r--r--lib/utils/shims/task.rb40
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