Class: Playwright::RouteHandler::CountDown
- Inherits:
-
Object
- Object
- Playwright::RouteHandler::CountDown
- Defined in:
- lib/playwright/route_handler.rb
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #handle ⇒ Object
-
#initialize(count) ⇒ CountDown
constructor
A new instance of CountDown.
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
15 16 17 |
# File 'lib/playwright/route_handler.rb', line 15 def expired? @count <= 0 end |
#handle ⇒ Object
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 |