Class: Puppeteer::WorkerWorld
- Inherits:
-
Object
- Object
- Puppeteer::WorkerWorld
- Defined in:
- lib/puppeteer/web_worker.rb
Overview
rbs_inline: enabled
Instance Method Summary collapse
- #dispose ⇒ Object
- #evaluate(page_function, *args) ⇒ Object
- #evaluate_handle(page_function, *args) ⇒ Object
- #execution_context ⇒ Object
- #frame ⇒ Object
-
#initialize(client) ⇒ WorkerWorld
constructor
A new instance of WorkerWorld.
- #set_context(context) ⇒ Object
Constructor Details
#initialize(client) ⇒ WorkerWorld
Returns a new instance of WorkerWorld.
8 9 10 11 |
# File 'lib/puppeteer/web_worker.rb', line 8 def initialize(client) @client = client @context_promise = Async::Promise.new end |
Instance Method Details
#dispose ⇒ Object
48 49 50 |
# File 'lib/puppeteer/web_worker.rb', line 48 def dispose @context_promise = Async::Promise.new end |
#evaluate(page_function, *args) ⇒ Object
27 28 29 |
# File 'lib/puppeteer/web_worker.rb', line 27 def evaluate(page_function, *args) execution_context.evaluate(page_function, *args) end |
#evaluate_handle(page_function, *args) ⇒ Object
36 37 38 |
# File 'lib/puppeteer/web_worker.rb', line 36 def evaluate_handle(page_function, *args) execution_context.evaluate_handle(page_function, *args) end |
#execution_context ⇒ Object
20 21 22 |
# File 'lib/puppeteer/web_worker.rb', line 20 def execution_context @context_promise.wait end |
#frame ⇒ Object
43 44 45 |
# File 'lib/puppeteer/web_worker.rb', line 43 def frame nil end |
#set_context(context) ⇒ Object
15 16 17 |
# File 'lib/puppeteer/web_worker.rb', line 15 def set_context(context) @context_promise.resolve(context) unless @context_promise.resolved? end |