Class: PlanningClient::ToDo

Inherits:
LogicalModel
  • Object
show all
Includes:
ServiceConfiguration
Defined in:
app/models/planning_client/to_do.rb

Instance Method Summary collapse

Methods included from ServiceConfiguration

included

Instance Method Details

#completeObject

mark ToDo as completed



46
47
48
49
50
51
52
53
# File 'app/models/planning_client/to_do.rb', line 46

def complete
  if self.status_transition("complete")
    self.state = 'completed'
    self
  else
    nil
  end
end

#holdObject

mark ToDo as in stand by



36
37
38
39
40
41
42
43
# File 'app/models/planning_client/to_do.rb', line 36

def hold
  if self.status_transition("hold")
    self.state = 'stand_by'
    self
  else
    nil
  end
end

#json_rootObject



55
56
57
# File 'app/models/planning_client/to_do.rb', line 55

def json_root
  'to_do'
end

#startObject

mark ToDo as in progress



26
27
28
29
30
31
32
33
# File 'app/models/planning_client/to_do.rb', line 26

def start
  if self.status_transition("start")
    self.state = 'in_progress'
    self
  else
    nil
  end
end