Class: Playwright::DisposableStub
- Inherits:
-
Object
- Object
- Playwright::DisposableStub
- Defined in:
- lib/playwright/utils.rb
Instance Method Summary collapse
- #dispose ⇒ Object
-
#initialize(&block) ⇒ DisposableStub
constructor
A new instance of DisposableStub.
Constructor Details
#initialize(&block) ⇒ DisposableStub
Returns a new instance of DisposableStub.
5 6 7 |
# File 'lib/playwright/utils.rb', line 5 def initialize(&block) @block = block end |
Instance Method Details
#dispose ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/playwright/utils.rb', line 9 def dispose return unless @block block = @block @block = nil block.call rescue TargetClosedError nil end |