Class: Playwright::RouteHandler::CountDown

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright/route_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(count) ⇒ CountDown

Returns a new instance of CountDown.



4
5
6
# File 'lib/playwright/route_handler.rb', line 4

def initialize(count)
  @count = count
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/playwright/route_handler.rb', line 15

def expired?
  @count <= 0
end

#handleObject



8
9
10
11
12
13
# File 'lib/playwright/route_handler.rb', line 8

def handle
  return false if expired?

  @count = @count - 1
  true
end