Class: Nomade::Decorator

Inherits:
Object
  • Object
show all
Defined in:
lib/nomade/decorators.rb

Class Method Summary collapse

Class Method Details

.task_state_decorator(task_state, task_failed) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/nomade/decorators.rb', line 3

def self.task_state_decorator(task_state, task_failed)
  case task_state
  when "pending"
    "Pending"
  when "running"
    "Running"
  when "dead"
    if task_failed
      "Failed with errors!"
    else
      "Completed succesfully!"
    end
  end
end