Class: Suture::Util::Timer
- Inherits:
-
Object
- Object
- Suture::Util::Timer
- Defined in:
- lib/suture/util/timer.rb
Instance Method Summary collapse
-
#initialize(limit_in_seconds) ⇒ Timer
constructor
A new instance of Timer.
- #time_up? ⇒ Boolean
Constructor Details
#initialize(limit_in_seconds) ⇒ Timer
Returns a new instance of Timer.
5 6 7 8 |
# File 'lib/suture/util/timer.rb', line 5 def initialize(limit_in_seconds) @started_at = Time.new @limit_in_seconds = limit_in_seconds end |
Instance Method Details
#time_up? ⇒ Boolean
10 11 12 |
# File 'lib/suture/util/timer.rb', line 10 def time_up? Time.new >= (@started_at + @limit_in_seconds) end |