Class: Timecrunch::Timer
- Inherits:
-
Object
- Object
- Timecrunch::Timer
- Defined in:
- lib/timecrunch/timer.rb
Instance Attribute Summary collapse
-
#notifiers ⇒ Object
Returns the value of attribute notifiers.
Instance Method Summary collapse
-
#initialize(times, *notifiers) ⇒ Timer
constructor
A new instance of Timer.
- #start! ⇒ Object
Constructor Details
#initialize(times, *notifiers) ⇒ Timer
Returns a new instance of Timer.
5 6 7 8 |
# File 'lib/timecrunch/timer.rb', line 5 def initialize(times, *notifiers) @times = times @notifiers = notifiers end |
Instance Attribute Details
#notifiers ⇒ Object
Returns the value of attribute notifiers.
3 4 5 |
# File 'lib/timecrunch/timer.rb', line 3 def notifiers @notifiers end |
Instance Method Details
#start! ⇒ Object
10 11 12 13 |
# File 'lib/timecrunch/timer.rb', line 10 def start! sleep(total_time) @notifiers.each { |notifier| notifier.notify! } end |