Class: Timer
- Inherits:
-
Object
- Object
- Timer
- Defined in:
- lib/tabata_timer/timer.rb
Instance Attribute Summary collapse
-
#break_time ⇒ Object
Returns the value of attribute break_time.
-
#exercise_time ⇒ Object
Returns the value of attribute exercise_time.
-
#iteration ⇒ Object
Returns the value of attribute iteration.
Instance Method Summary collapse
-
#initialize ⇒ Timer
constructor
A new instance of Timer.
- #start ⇒ Object
Constructor Details
#initialize ⇒ Timer
Returns a new instance of Timer.
4 5 6 7 8 |
# File 'lib/tabata_timer/timer.rb', line 4 def initialize @exercise_time = 20 @break_time = 10 @iteration = 20 end |
Instance Attribute Details
#break_time ⇒ Object
Returns the value of attribute break_time.
2 3 4 |
# File 'lib/tabata_timer/timer.rb', line 2 def break_time @break_time end |
#exercise_time ⇒ Object
Returns the value of attribute exercise_time.
2 3 4 |
# File 'lib/tabata_timer/timer.rb', line 2 def exercise_time @exercise_time end |
#iteration ⇒ Object
Returns the value of attribute iteration.
2 3 4 |
# File 'lib/tabata_timer/timer.rb', line 2 def iteration @iteration end |
Instance Method Details
#start ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/tabata_timer/timer.rb', line 10 def start @iteration.times do `say workout!` sleep(@exercise_time) `say break!` sleep(@break_time) end `say you very best!` end |