Class: Blinker::Timer
- Inherits:
-
Object
- Object
- Blinker::Timer
- 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
-
#initialize(total_min = 5, spurt_min = 1) ⇒ Timer
constructor
A new instance of Timer.
- #start ⇒ Object
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
#start ⇒ Object
18 19 20 21 22 23 |
# File 'lib/blinker/timer.rb', line 18 def start in_progress last_spurt countdown finish end |