Class: Nimo::Timer
Instance Method Summary collapse
-
#initialize(start_time, delay_in_seconds, action) ⇒ Timer
constructor
A new instance of Timer.
- #run_action ⇒ Object
- #time_is_up? ⇒ Boolean
Constructor Details
#initialize(start_time, delay_in_seconds, action) ⇒ Timer
Returns a new instance of Timer.
90 91 92 |
# File 'lib/nimo/screen.rb', line 90 def initialize(start_time, delay_in_seconds, action) @start_time, @delay_in_seconds, @action = start_time, delay_in_seconds, action end |
Instance Method Details
#run_action ⇒ Object
98 99 100 |
# File 'lib/nimo/screen.rb', line 98 def run_action @action.call end |
#time_is_up? ⇒ Boolean
94 95 96 |
# File 'lib/nimo/screen.rb', line 94 def time_is_up? (Time.now.to_f - @start_time) > @delay_in_seconds end |