Class: CypressRails::Server::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/cypress-rails/server/timer.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/cypress-rails/server/timer.rb', line 9

def expired?
  current - @start >= @expire_in
end

#stalled?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cypress-rails/server/timer.rb', line 13

def stalled?
  @start == current
end