Class: CypressRails::Server::Timer
- Inherits:
-
Object
- Object
- CypressRails::Server::Timer
- Defined in:
- lib/cypress-rails/server/timer.rb
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(expire_in) ⇒ Timer
constructor
A new instance of Timer.
- #stalled? ⇒ Boolean
Constructor Details
#initialize(expire_in) ⇒ Timer
Returns a new instance of Timer.
4 5 6 7 |
# File 'lib/cypress-rails/server/timer.rb', line 4 def initialize(expire_in) @start = current @expire_in = expire_in end |
Instance Method Details
#expired? ⇒ Boolean
9 10 11 |
# File 'lib/cypress-rails/server/timer.rb', line 9 def expired? current - @start >= @expire_in end |
#stalled? ⇒ Boolean
13 14 15 |
# File 'lib/cypress-rails/server/timer.rb', line 13 def stalled? @start == current end |