Class: Tabata
- Inherits:
-
Object
- Object
- Tabata
- Defined in:
- lib/tabata_timer/tabata.rb
Instance Attribute Summary collapse
-
#break_timer ⇒ Object
Returns the value of attribute break_timer.
-
#exercise_timer ⇒ Object
Returns the value of attribute exercise_timer.
-
#iteration ⇒ Object
Returns the value of attribute iteration.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(exercise_timer = Timers::Exercise.new, break_timer = Timers::Break.new, iteration = 20) ⇒ Tabata
constructor
A new instance of Tabata.
- #start ⇒ Object
Constructor Details
#initialize(exercise_timer = Timers::Exercise.new, break_timer = Timers::Break.new, iteration = 20) ⇒ Tabata
Returns a new instance of Tabata.
8 9 10 11 12 |
# File 'lib/tabata_timer/tabata.rb', line 8 def initialize(exercise_timer = Timers::Exercise.new, break_timer = Timers::Break.new, iteration = 20) @exercise_timer = exercise_timer @break_timer = break_timer @iteration = iteration end |
Instance Attribute Details
#break_timer ⇒ Object
Returns the value of attribute break_timer.
2 3 4 |
# File 'lib/tabata_timer/tabata.rb', line 2 def break_timer @break_timer end |
#exercise_timer ⇒ Object
Returns the value of attribute exercise_timer.
2 3 4 |
# File 'lib/tabata_timer/tabata.rb', line 2 def exercise_timer @exercise_timer end |
#iteration ⇒ Object
Returns the value of attribute iteration.
2 3 4 |
# File 'lib/tabata_timer/tabata.rb', line 2 def iteration @iteration end |
Class Method Details
.start ⇒ Object
4 5 6 |
# File 'lib/tabata_timer/tabata.rb', line 4 def self.start Tabata.new.start end |
Instance Method Details
#start ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/tabata_timer/tabata.rb', line 14 def start @iteration.times do |i| print_round(i) @exercise_timer.start @break_timer.start end `say you very best!` end |