Class: Blinker::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/blinker/timer.rb

Constant Summary collapse

GREEN =
[0, 255, 0].freeze
RED =
[255, 0, 0].freeze
YELLOW =
[255, 255, 0].freeze
COUNTDOWN_SECONDS =
10.freeze

Instance Method Summary collapse

Constructor Details

#initialize(total_min = 5, spurt_min = 1) ⇒ Timer

Returns a new instance of Timer.



11
12
13
14
15
16
# File 'lib/blinker/timer.rb', line 11

def initialize(total_min = 5, spurt_min = 1)
  @total_sec = total_min.to_i * 60
  @spurt_sec = spurt_min.to_i * 60
  @blink1 = Blink1.new
  @blink1.open
end

Instance Method Details

#startObject



18
19
20
21
22
23
# File 'lib/blinker/timer.rb', line 18

def start
  in_progress
  last_spurt
  countdown
  finish
end