Class: Mutx::API::Task
- Inherits:
-
Object
- Object
- Mutx::API::Task
- Defined in:
- lib/mutx/API/task.rb
Class Method Summary collapse
Class Method Details
.info(task_id) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mutx/API/task.rb', line 7 def self.info(task_id) response = { "project_name" => Dir.pwd.split("/").last, "task" => nil, "message" => nil } task = Mutx::Tasks::Task.get(task_id) Mutx::Support::Log.debug "Task info for '#{task_id}'" if task.nil? response["message"] = "Task not found" else response["task"] = task.api_response end response end |
.info_for_name(task_name) ⇒ Object
23 24 25 26 27 |
# File 'lib/mutx/API/task.rb', line 23 def self.info_for_name task_name Mutx::Support::Log.debug "Asked info for '#{task_name}'" task_id = Mutx::Tasks.task_id_for(task_name) self.info(task_id) end |
.status(task_id) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mutx/API/task.rb', line 30 def self.status task_id Mutx::Support::Log.debug "Task status for '#{task_id}'" response = info(task_id) output = if response["message"] { "task_id" => nil, "message" => response["message"] } else { "task_id" => response["task"]["_id"], "status" => response["task"]["status"] } end output end |