Module: Pomodoro::Formats::Today::TaskStatuses

Included in:
Task
Defined in:
lib/pomodoro/formats/today/task/statuses.rb

Status checking methods collapse

Status setters collapse

Instance Method Details

#complete!Object



48
49
50
51
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 48

def complete!
  @end_time = Hour.now if @start_time
  @status = :completed
end

#completed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 22

def completed?
  @status == :done && ! self.['Reason']
end

#delete!(reason) ⇒ Object



58
59
60
61
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 58

def delete!(reason)
  @end_time = Hour.now if @start_time
  @status = :failed
end

#deleted?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 34

def deleted?
  @status == :failed && self.['Deleted']
end

#ended?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 4

def ended?
  [:done, :failed].include?(@status)
end

#finish_for_the_day!Object



43
44
45
46
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 43

def finish_for_the_day!
  @end_time = Hour.now if @start_time
  @status = :progress_made
end

#in_progress?Boolean Also known as: started?

Returns:

  • (Boolean)


16
17
18
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 16

def in_progress?
  (! @start_time.nil? && @end_time.nil?) && @status == :not_done
end

#postpone!(reason, next_review) ⇒ Object



53
54
55
56
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 53

def postpone!(reason, next_review)
  @end_time = Hour.now if @start_time
  @status = :failed
end

#postponed?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 30

def postponed?
  @status == :failed && self.['Postponed']
end

#progress_made_but_not_finished?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 26

def progress_made_but_not_finished?
  @status == :done && self.['Reason']
end

#skipped?(time_frame) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 12

def skipped?(time_frame)
  self.unstarted? && time_frame.ended?
end

#start!Object



39
40
41
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 39

def start!
  @status, @start_time = :in_progress, Hour.now
end

#unstarted?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/pomodoro/formats/today/task/statuses.rb', line 8

def unstarted?
  @start_time.nil? && @status == :not_done
end