class Paradeiser::Pomodoro
Constants
- MINUTES_25
Attributes
annotations[R]
canceled_at[RW]
interrupt_type[R]
interrupts[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/paradeiser/models/pomodoro.rb, line 52 def initialize super # required for state_machine @interrupts = [] @annotations = [] start! end
Public Instance Methods
annotate(text)
click to toggle source
# File lib/paradeiser/models/pomodoro.rb, line 74 def annotate(text) @annotations << text end
duration()
click to toggle source
# File lib/paradeiser/models/pomodoro.rb, line 68 def duration start = started_at || Time.now finish = finished_at || canceled_at || Time.now (finish - start).to_i end
interrupt!(type = nil)
click to toggle source
Calls superclass method
# File lib/paradeiser/models/pomodoro.rb, line 63 def interrupt!(type = nil) @interrupt_type = type super end
length()
click to toggle source
# File lib/paradeiser/models/pomodoro.rb, line 59 def length MINUTES_25 * 60 end