puppeteer-ruby 0.0.13 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -14
- data/.github/workflows/docs.yml +45 -0
- data/.github/workflows/reviewdog.yml +15 -0
- data/.rubocop.yml +39 -3
- data/README.md +54 -1
- data/lib/puppeteer.rb +10 -2
- data/lib/puppeteer/browser.rb +53 -34
- data/lib/puppeteer/browser_context.rb +35 -5
- data/lib/puppeteer/cdp_session.rb +3 -19
- data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
- data/lib/puppeteer/connection.rb +9 -16
- data/lib/puppeteer/debug_print.rb +1 -1
- data/lib/puppeteer/define_async_method.rb +23 -0
- data/lib/puppeteer/dom_world.rb +84 -73
- data/lib/puppeteer/element_handle.rb +46 -63
- data/lib/puppeteer/emulation_manager.rb +2 -6
- data/lib/puppeteer/env.rb +18 -0
- data/lib/puppeteer/execution_context.rb +1 -6
- data/lib/puppeteer/frame.rb +46 -46
- data/lib/puppeteer/frame_manager.rb +7 -25
- data/lib/puppeteer/js_handle.rb +39 -38
- data/lib/puppeteer/keyboard.rb +9 -29
- data/lib/puppeteer/mouse.rb +20 -24
- data/lib/puppeteer/network_manager.rb +163 -5
- data/lib/puppeteer/page.rb +221 -181
- data/lib/puppeteer/page/pdf_options.rb +166 -0
- data/lib/puppeteer/remote_object.rb +18 -5
- data/lib/puppeteer/request.rb +330 -0
- data/lib/puppeteer/response.rb +113 -0
- data/lib/puppeteer/touch_screen.rb +2 -7
- data/lib/puppeteer/version.rb +1 -1
- data/lib/puppeteer/wait_task.rb +3 -5
- data/lib/puppeteer/web_socket.rb +7 -0
- data/puppeteer-ruby.gemspec +2 -1
- metadata +25 -103
- data/docs/Puppeteer.html +0 -2338
- data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
- data/docs/Puppeteer/Browser.html +0 -2258
- data/docs/Puppeteer/BrowserContext.html +0 -809
- data/docs/Puppeteer/BrowserFetcher.html +0 -214
- data/docs/Puppeteer/BrowserRunner.html +0 -914
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
- data/docs/Puppeteer/CDPSession.html +0 -813
- data/docs/Puppeteer/CDPSession/Error.html +0 -124
- data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
- data/docs/Puppeteer/Connection.html +0 -964
- data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
- data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
- data/docs/Puppeteer/ConsoleMessage.html +0 -565
- data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
- data/docs/Puppeteer/DOMWorld.html +0 -2293
- data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
- data/docs/Puppeteer/DebugPrint.html +0 -233
- data/docs/Puppeteer/Device.html +0 -470
- data/docs/Puppeteer/Devices.html +0 -139
- data/docs/Puppeteer/ElementHandle.html +0 -2542
- data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
- data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
- data/docs/Puppeteer/ElementHandle/Point.html +0 -492
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
- data/docs/Puppeteer/EmulationManager.html +0 -454
- data/docs/Puppeteer/EventCallbackable.html +0 -499
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
- data/docs/Puppeteer/ExecutionContext.html +0 -998
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
- data/docs/Puppeteer/FileChooser.html +0 -455
- data/docs/Puppeteer/Frame.html +0 -3835
- data/docs/Puppeteer/FrameManager.html +0 -2410
- data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
- data/docs/Puppeteer/IfPresent.html +0 -222
- data/docs/Puppeteer/JSHandle.html +0 -1352
- data/docs/Puppeteer/Keyboard.html +0 -1557
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
- data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
- data/docs/Puppeteer/Launcher.html +0 -237
- data/docs/Puppeteer/Launcher/Base.html +0 -385
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
- data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
- data/docs/Puppeteer/Launcher/Chrome.html +0 -674
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
- data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
- data/docs/Puppeteer/LifecycleWatcher.html +0 -834
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
- data/docs/Puppeteer/Mouse.html +0 -1095
- data/docs/Puppeteer/Mouse/Button.html +0 -136
- data/docs/Puppeteer/NetworkManager.html +0 -901
- data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
- data/docs/Puppeteer/Page.html +0 -6173
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
- data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
- data/docs/Puppeteer/Page/ScriptTag.html +0 -555
- data/docs/Puppeteer/Page/StyleTag.html +0 -448
- data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
- data/docs/Puppeteer/RemoteObject.html +0 -1087
- data/docs/Puppeteer/Target.html +0 -1336
- data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
- data/docs/Puppeteer/Target/TargetInfo.html +0 -729
- data/docs/Puppeteer/TimeoutError.html +0 -135
- data/docs/Puppeteer/TimeoutSettings.html +0 -496
- data/docs/Puppeteer/TouchScreen.html +0 -464
- data/docs/Puppeteer/Viewport.html +0 -837
- data/docs/Puppeteer/WaitTask.html +0 -637
- data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
- data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
- data/docs/Puppeteer/WebSocket.html +0 -673
- data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
- data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
- data/docs/Puppeteer/WebSocketTransport.html +0 -600
- data/docs/Puppeteer/WebSocktTransportError.html +0 -124
- data/docs/_index.html +0 -816
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.README.html +0 -125
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -125
- data/docs/js/app.js +0 -314
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -4123
- data/docs/top-level-namespace.html +0 -126
- data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,600 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: Puppeteer::WebSocketTransport
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.24
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
-
|
17
|
-
<script type="text/javascript">
|
18
|
-
pathId = "Puppeteer::WebSocketTransport";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (W)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">WebSocketTransport</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: Puppeteer::WebSocketTransport
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Object</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">Puppeteer::WebSocketTransport</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/puppeteer/web_socket_transport.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<h2>
|
111
|
-
Class Method Summary
|
112
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
113
|
-
</h2>
|
114
|
-
|
115
|
-
<ul class="summary">
|
116
|
-
|
117
|
-
<li class="public ">
|
118
|
-
<span class="summary_signature">
|
119
|
-
|
120
|
-
<a href="#create-class_method" title="create (class method)">.<strong>create</strong>(url) ⇒ Puppeteer::WebSocketTransport </a>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
</span>
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
135
|
-
|
136
|
-
</li>
|
137
|
-
|
138
|
-
|
139
|
-
</ul>
|
140
|
-
|
141
|
-
<h2>
|
142
|
-
Instance Method Summary
|
143
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
144
|
-
</h2>
|
145
|
-
|
146
|
-
<ul class="summary">
|
147
|
-
|
148
|
-
<li class="public ">
|
149
|
-
<span class="summary_signature">
|
150
|
-
|
151
|
-
<a href="#close-instance_method" title="#close (instance method)">#<strong>close</strong> ⇒ Object </a>
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
</span>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
166
|
-
|
167
|
-
</li>
|
168
|
-
|
169
|
-
|
170
|
-
<li class="public ">
|
171
|
-
<span class="summary_signature">
|
172
|
-
|
173
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(web_socket) ⇒ WebSocketTransport </a>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
</span>
|
178
|
-
|
179
|
-
|
180
|
-
<span class="note title constructor">constructor</span>
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
<span class="summary_desc"><div class='inline'>
|
190
|
-
<p>A new instance of WebSocketTransport.</p>
|
191
|
-
</div></span>
|
192
|
-
|
193
|
-
</li>
|
194
|
-
|
195
|
-
|
196
|
-
<li class="public ">
|
197
|
-
<span class="summary_signature">
|
198
|
-
|
199
|
-
<a href="#on_close-instance_method" title="#on_close (instance method)">#<strong>on_close</strong>(&block) ⇒ Object </a>
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
</span>
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
214
|
-
|
215
|
-
</li>
|
216
|
-
|
217
|
-
|
218
|
-
<li class="public ">
|
219
|
-
<span class="summary_signature">
|
220
|
-
|
221
|
-
<a href="#on_message-instance_method" title="#on_message (instance method)">#<strong>on_message</strong>(&block) ⇒ Object </a>
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
</span>
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
236
|
-
|
237
|
-
</li>
|
238
|
-
|
239
|
-
|
240
|
-
<li class="public ">
|
241
|
-
<span class="summary_signature">
|
242
|
-
|
243
|
-
<a href="#send_text-instance_method" title="#send_text (instance method)">#<strong>send_text</strong>(message) ⇒ Object </a>
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
</span>
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
258
|
-
|
259
|
-
</li>
|
260
|
-
|
261
|
-
|
262
|
-
</ul>
|
263
|
-
|
264
|
-
|
265
|
-
<div id="constructor_details" class="method_details_list">
|
266
|
-
<h2>Constructor Details</h2>
|
267
|
-
|
268
|
-
<div class="method_details first">
|
269
|
-
<h3 class="signature first" id="initialize-instance_method">
|
270
|
-
|
271
|
-
#<strong>initialize</strong>(web_socket) ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::WebSocketTransport (class)">WebSocketTransport</a></span></tt>
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
</h3><div class="docstring">
|
278
|
-
<div class="discussion">
|
279
|
-
|
280
|
-
<p>Returns a new instance of WebSocketTransport.</p>
|
281
|
-
|
282
|
-
|
283
|
-
</div>
|
284
|
-
</div>
|
285
|
-
<div class="tags">
|
286
|
-
<p class="tag_title">Parameters:</p>
|
287
|
-
<ul class="param">
|
288
|
-
|
289
|
-
<li>
|
290
|
-
|
291
|
-
<span class='name'>web_socket</span>
|
292
|
-
|
293
|
-
|
294
|
-
<span class='type'>(<tt>!WebSocket::Driver</tt>)</span>
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
</li>
|
299
|
-
|
300
|
-
</ul>
|
301
|
-
|
302
|
-
|
303
|
-
</div><table class="source_code">
|
304
|
-
<tr>
|
305
|
-
<td>
|
306
|
-
<pre class="lines">
|
307
|
-
|
308
|
-
|
309
|
-
20
|
310
|
-
21
|
311
|
-
22
|
312
|
-
23
|
313
|
-
24
|
314
|
-
25
|
315
|
-
26
|
316
|
-
27
|
317
|
-
28
|
318
|
-
29
|
319
|
-
30
|
320
|
-
31</pre>
|
321
|
-
</td>
|
322
|
-
<td>
|
323
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 20</span>
|
324
|
-
|
325
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_web_socket'>web_socket</span><span class='rparen'>)</span>
|
326
|
-
<span class='ivar'>@ws</span> <span class='op'>=</span> <span class='id identifier rubyid_web_socket'>web_socket</span>
|
327
|
-
<span class='ivar'>@ws</span><span class='period'>.</span><span class='id identifier rubyid_on_message'>on_message</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
328
|
-
<span class='ivar'>@on_message</span><span class='op'>&.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
329
|
-
<span class='kw'>end</span>
|
330
|
-
<span class='ivar'>@ws</span><span class='period'>.</span><span class='id identifier rubyid_on_close'>on_close</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='id identifier rubyid_code'>code</span><span class='op'>|</span>
|
331
|
-
<span class='ivar'>@on_close</span><span class='op'>&.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span>
|
332
|
-
<span class='kw'>end</span>
|
333
|
-
<span class='ivar'>@ws</span><span class='period'>.</span><span class='id identifier rubyid_on_error'>on_error</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_error'>error</span><span class='op'>|</span>
|
334
|
-
<span class='comment'># Silently ignore all errors - we don't know what to do with them.
|
335
|
-
</span> <span class='kw'>end</span>
|
336
|
-
<span class='kw'>end</span></pre>
|
337
|
-
</td>
|
338
|
-
</tr>
|
339
|
-
</table>
|
340
|
-
</div>
|
341
|
-
|
342
|
-
</div>
|
343
|
-
|
344
|
-
|
345
|
-
<div id="class_method_details" class="method_details_list">
|
346
|
-
<h2>Class Method Details</h2>
|
347
|
-
|
348
|
-
|
349
|
-
<div class="method_details first">
|
350
|
-
<h3 class="signature first" id="create-class_method">
|
351
|
-
|
352
|
-
.<strong>create</strong>(url) ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::WebSocketTransport (class)">Puppeteer::WebSocketTransport</a></span></tt>
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
</h3><div class="docstring">
|
359
|
-
<div class="discussion">
|
360
|
-
|
361
|
-
|
362
|
-
</div>
|
363
|
-
</div>
|
364
|
-
<div class="tags">
|
365
|
-
<p class="tag_title">Parameters:</p>
|
366
|
-
<ul class="param">
|
367
|
-
|
368
|
-
<li>
|
369
|
-
|
370
|
-
<span class='name'>url</span>
|
371
|
-
|
372
|
-
|
373
|
-
<span class='type'>(<tt>string</tt>)</span>
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
</li>
|
378
|
-
|
379
|
-
</ul>
|
380
|
-
|
381
|
-
<p class="tag_title">Returns:</p>
|
382
|
-
<ul class="return">
|
383
|
-
|
384
|
-
<li>
|
385
|
-
|
386
|
-
|
387
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Puppeteer::WebSocketTransport (class)">Puppeteer::WebSocketTransport</a></span></tt>)</span>
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
</li>
|
392
|
-
|
393
|
-
</ul>
|
394
|
-
|
395
|
-
</div><table class="source_code">
|
396
|
-
<tr>
|
397
|
-
<td>
|
398
|
-
<pre class="lines">
|
399
|
-
|
400
|
-
|
401
|
-
4
|
402
|
-
5
|
403
|
-
6
|
404
|
-
7
|
405
|
-
8
|
406
|
-
9
|
407
|
-
10
|
408
|
-
11
|
409
|
-
12
|
410
|
-
13
|
411
|
-
14
|
412
|
-
15
|
413
|
-
16
|
414
|
-
17</pre>
|
415
|
-
</td>
|
416
|
-
<td>
|
417
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 4</span>
|
418
|
-
|
419
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
420
|
-
<span class='id identifier rubyid_ws'>ws</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="WebSocket.html" title="Puppeteer::WebSocket (class)">WebSocket</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="WebSocket.html#initialize-instance_method" title="Puppeteer::WebSocket#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
421
|
-
<span class='label'>url:</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
|
422
|
-
<span class='label'>max_payload_size:</span> <span class='int'>256</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1024</span><span class='comma'>,</span> <span class='comment'># 256MB
|
423
|
-
</span> <span class='rparen'>)</span>
|
424
|
-
<span class='lparen'>(</span><span class='id identifier rubyid_resolvable_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#resolvable_future-instance_method" title="Puppeteer::ConcurrentRubyUtils#resolvable_future (method)">resolvable_future</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#future-instance_method" title="Puppeteer::ConcurrentRubyUtils#future (method)">future</a></span></span><span class='op'>|</span>
|
425
|
-
<span class='id identifier rubyid_ws'>ws</span><span class='period'>.</span><span class='id identifier rubyid_on_open'>on_open</span> <span class='kw'>do</span>
|
426
|
-
<span class='id identifier rubyid_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#future-instance_method" title="Puppeteer::ConcurrentRubyUtils#future (method)">future</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fulfill'>fulfill</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Puppeteer::WebSocketTransport (class)">WebSocketTransport</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::WebSocketTransport#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_ws'>ws</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
427
|
-
<span class='kw'>end</span>
|
428
|
-
<span class='id identifier rubyid_ws'>ws</span><span class='period'>.</span><span class='id identifier rubyid_on_error'>on_error</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_error_message'>error_message</span><span class='op'>|</span>
|
429
|
-
<span class='id identifier rubyid_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#future-instance_method" title="Puppeteer::ConcurrentRubyUtils#future (method)">future</a></span></span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="WebSocket.html" title="Puppeteer::WebSocket (class)">WebSocket</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="WebSocket/TransportError.html" title="Puppeteer::WebSocket::TransportError (class)">TransportError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="WebSocket.html#initialize-instance_method" title="Puppeteer::WebSocket#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
430
|
-
<span class='kw'>end</span>
|
431
|
-
<span class='kw'>end</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
|
432
|
-
<span class='kw'>end</span></pre>
|
433
|
-
</td>
|
434
|
-
</tr>
|
435
|
-
</table>
|
436
|
-
</div>
|
437
|
-
|
438
|
-
</div>
|
439
|
-
|
440
|
-
<div id="instance_method_details" class="method_details_list">
|
441
|
-
<h2>Instance Method Details</h2>
|
442
|
-
|
443
|
-
|
444
|
-
<div class="method_details first">
|
445
|
-
<h3 class="signature first" id="close-instance_method">
|
446
|
-
|
447
|
-
#<strong>close</strong> ⇒ <tt>Object</tt>
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
</h3><table class="source_code">
|
454
|
-
<tr>
|
455
|
-
<td>
|
456
|
-
<pre class="lines">
|
457
|
-
|
458
|
-
|
459
|
-
38
|
460
|
-
39
|
461
|
-
40</pre>
|
462
|
-
</td>
|
463
|
-
<td>
|
464
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 38</span>
|
465
|
-
|
466
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
467
|
-
<span class='ivar'>@ws</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
468
|
-
<span class='kw'>end</span></pre>
|
469
|
-
</td>
|
470
|
-
</tr>
|
471
|
-
</table>
|
472
|
-
</div>
|
473
|
-
|
474
|
-
<div class="method_details ">
|
475
|
-
<h3 class="signature " id="on_close-instance_method">
|
476
|
-
|
477
|
-
#<strong>on_close</strong>(&block) ⇒ <tt>Object</tt>
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
</h3><table class="source_code">
|
484
|
-
<tr>
|
485
|
-
<td>
|
486
|
-
<pre class="lines">
|
487
|
-
|
488
|
-
|
489
|
-
42
|
490
|
-
43
|
491
|
-
44</pre>
|
492
|
-
</td>
|
493
|
-
<td>
|
494
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 42</span>
|
495
|
-
|
496
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_on_close'>on_close</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
497
|
-
<span class='ivar'>@on_close</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
498
|
-
<span class='kw'>end</span></pre>
|
499
|
-
</td>
|
500
|
-
</tr>
|
501
|
-
</table>
|
502
|
-
</div>
|
503
|
-
|
504
|
-
<div class="method_details ">
|
505
|
-
<h3 class="signature " id="on_message-instance_method">
|
506
|
-
|
507
|
-
#<strong>on_message</strong>(&block) ⇒ <tt>Object</tt>
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
</h3><table class="source_code">
|
514
|
-
<tr>
|
515
|
-
<td>
|
516
|
-
<pre class="lines">
|
517
|
-
|
518
|
-
|
519
|
-
46
|
520
|
-
47
|
521
|
-
48</pre>
|
522
|
-
</td>
|
523
|
-
<td>
|
524
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 46</span>
|
525
|
-
|
526
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_on_message'>on_message</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
527
|
-
<span class='ivar'>@on_message</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
528
|
-
<span class='kw'>end</span></pre>
|
529
|
-
</td>
|
530
|
-
</tr>
|
531
|
-
</table>
|
532
|
-
</div>
|
533
|
-
|
534
|
-
<div class="method_details ">
|
535
|
-
<h3 class="signature " id="send_text-instance_method">
|
536
|
-
|
537
|
-
#<strong>send_text</strong>(message) ⇒ <tt>Object</tt>
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
</h3><div class="docstring">
|
544
|
-
<div class="discussion">
|
545
|
-
|
546
|
-
|
547
|
-
</div>
|
548
|
-
</div>
|
549
|
-
<div class="tags">
|
550
|
-
<p class="tag_title">Parameters:</p>
|
551
|
-
<ul class="param">
|
552
|
-
|
553
|
-
<li>
|
554
|
-
|
555
|
-
<span class='name'>message</span>
|
556
|
-
|
557
|
-
|
558
|
-
<span class='type'>(<tt>String</tt>)</span>
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
</li>
|
563
|
-
|
564
|
-
</ul>
|
565
|
-
|
566
|
-
|
567
|
-
</div><table class="source_code">
|
568
|
-
<tr>
|
569
|
-
<td>
|
570
|
-
<pre class="lines">
|
571
|
-
|
572
|
-
|
573
|
-
34
|
574
|
-
35
|
575
|
-
36</pre>
|
576
|
-
</td>
|
577
|
-
<td>
|
578
|
-
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket_transport.rb', line 34</span>
|
579
|
-
|
580
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_send_text'>send_text</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
581
|
-
<span class='ivar'>@ws</span><span class='period'>.</span><span class='id identifier rubyid_send_text'>send_text</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
582
|
-
<span class='kw'>end</span></pre>
|
583
|
-
</td>
|
584
|
-
</tr>
|
585
|
-
</table>
|
586
|
-
</div>
|
587
|
-
|
588
|
-
</div>
|
589
|
-
|
590
|
-
</div>
|
591
|
-
|
592
|
-
<div id="footer">
|
593
|
-
Generated on Wed Jun 24 03:08:01 2020 by
|
594
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
595
|
-
0.9.24 (ruby-2.6.3).
|
596
|
-
</div>
|
597
|
-
|
598
|
-
</div>
|
599
|
-
</body>
|
600
|
-
</html>
|