Class: Timer
- Inherits:
-
Object
- Object
- Timer
- Defined in:
- lib/tabata_timer/timer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(time, message = '') ⇒ Timer
constructor
A new instance of Timer.
- #start ⇒ Object
Constructor Details
#initialize(time, message = '') ⇒ Timer
Returns a new instance of Timer.
4 5 6 7 |
# File 'lib/tabata_timer/timer.rb', line 4 def initialize(time, = '') @time = time @message = end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
2 3 4 |
# File 'lib/tabata_timer/timer.rb', line 2 def time @time end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/tabata_timer/timer.rb', line 14 def ==(other) self.time == other.time end |
#start ⇒ Object
9 10 11 12 |
# File 'lib/tabata_timer/timer.rb', line 9 def start `say #{@message}` sleep(@time) end |