puppeteer-ruby 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.circleci/config.yml +71 -0
- data/.github/stale.yml +16 -0
- data/.gitignore +19 -0
- data/.rspec +3 -0
- data/.rubocop.yml +302 -0
- data/.travis.yml +7 -0
- data/Dockerfile +6 -0
- data/Gemfile +6 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/docker-compose.yml +15 -0
- data/docs/Puppeteer.html +2020 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2148 -0
- data/docs/Puppeteer/BrowserContext.html +809 -0
- data/docs/Puppeteer/BrowserFetcher.html +214 -0
- data/docs/Puppeteer/BrowserRunner.html +914 -0
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
- data/docs/Puppeteer/CDPSession.html +813 -0
- data/docs/Puppeteer/CDPSession/Error.html +124 -0
- data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
- data/docs/Puppeteer/Connection.html +960 -0
- data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
- data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
- data/docs/Puppeteer/ConsoleMessage.html +565 -0
- data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
- data/docs/Puppeteer/DOMWorld.html +2219 -0
- data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
- data/docs/Puppeteer/DebugPrint.html +233 -0
- data/docs/Puppeteer/Device.html +470 -0
- data/docs/Puppeteer/Devices.html +139 -0
- data/docs/Puppeteer/ElementHandle.html +2542 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +492 -0
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
- data/docs/Puppeteer/EmulationManager.html +454 -0
- data/docs/Puppeteer/EventCallbackable.html +433 -0
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
- data/docs/Puppeteer/ExecutionContext.html +998 -0
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
- data/docs/Puppeteer/FileChooser.html +455 -0
- data/docs/Puppeteer/Frame.html +3677 -0
- data/docs/Puppeteer/FrameManager.html +2410 -0
- data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
- data/docs/Puppeteer/IfPresent.html +222 -0
- data/docs/Puppeteer/JSHandle.html +1352 -0
- data/docs/Puppeteer/Keyboard.html +1557 -0
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
- data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
- data/docs/Puppeteer/Launcher.html +237 -0
- data/docs/Puppeteer/Launcher/Base.html +385 -0
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
- data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
- data/docs/Puppeteer/Launcher/Chrome.html +669 -0
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
- data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
- data/docs/Puppeteer/LifecycleWatcher.html +834 -0
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
- data/docs/Puppeteer/Mouse.html +1105 -0
- data/docs/Puppeteer/Mouse/Button.html +136 -0
- data/docs/Puppeteer/NetworkManager.html +901 -0
- data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
- data/docs/Puppeteer/Page.html +5970 -0
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -0
- data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
- data/docs/Puppeteer/Page/ScriptTag.html +555 -0
- data/docs/Puppeteer/Page/StyleTag.html +448 -0
- data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
- data/docs/Puppeteer/RemoteObject.html +1087 -0
- data/docs/Puppeteer/Target.html +1336 -0
- data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
- data/docs/Puppeteer/Target/TargetInfo.html +729 -0
- data/docs/Puppeteer/TimeoutError.html +135 -0
- data/docs/Puppeteer/TimeoutSettings.html +496 -0
- data/docs/Puppeteer/TouchScreen.html +464 -0
- data/docs/Puppeteer/Viewport.html +837 -0
- data/docs/Puppeteer/WaitTask.html +637 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
- data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -0
- data/docs/Puppeteer/WebSocket.html +673 -0
- data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
- data/docs/Puppeteer/WebSocketTransport.html +600 -0
- data/docs/Puppeteer/WebSocktTransportError.html +124 -0
- data/docs/_index.html +823 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +123 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +123 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +4075 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +200 -0
- data/lib/puppeteer/async_await_behavior.rb +38 -0
- data/lib/puppeteer/browser.rb +259 -0
- data/lib/puppeteer/browser_context.rb +90 -0
- data/lib/puppeteer/browser_fetcher.rb +6 -0
- data/lib/puppeteer/browser_runner.rb +161 -0
- data/lib/puppeteer/cdp_session.rb +100 -0
- data/lib/puppeteer/concurrent_ruby_utils.rb +37 -0
- data/lib/puppeteer/connection.rb +254 -0
- data/lib/puppeteer/console_message.rb +24 -0
- data/lib/puppeteer/debug_print.rb +20 -0
- data/lib/puppeteer/device.rb +12 -0
- data/lib/puppeteer/devices.rb +885 -0
- data/lib/puppeteer/dom_world.rb +484 -0
- data/lib/puppeteer/element_handle.rb +433 -0
- data/lib/puppeteer/element_handle/bounding_box.rb +12 -0
- data/lib/puppeteer/element_handle/box_model.rb +19 -0
- data/lib/puppeteer/element_handle/point.rb +26 -0
- data/lib/puppeteer/emulation_manager.rb +46 -0
- data/lib/puppeteer/errors.rb +2 -0
- data/lib/puppeteer/event_callbackable.rb +88 -0
- data/lib/puppeteer/execution_context.rb +254 -0
- data/lib/puppeteer/file_chooser.rb +29 -0
- data/lib/puppeteer/frame.rb +286 -0
- data/lib/puppeteer/frame_manager.rb +378 -0
- data/lib/puppeteer/if_present.rb +18 -0
- data/lib/puppeteer/js_handle.rb +142 -0
- data/lib/puppeteer/keyboard.rb +183 -0
- data/lib/puppeteer/keyboard/key_description.rb +19 -0
- data/lib/puppeteer/keyboard/us_keyboard_layout.rb +283 -0
- data/lib/puppeteer/launcher.rb +25 -0
- data/lib/puppeteer/launcher/base.rb +48 -0
- data/lib/puppeteer/launcher/browser_options.rb +41 -0
- data/lib/puppeteer/launcher/chrome.rb +211 -0
- data/lib/puppeteer/launcher/chrome_arg_options.rb +49 -0
- data/lib/puppeteer/launcher/launch_options.rb +68 -0
- data/lib/puppeteer/lifecycle_watcher.rb +171 -0
- data/lib/puppeteer/mouse.rb +123 -0
- data/lib/puppeteer/network_manager.rb +122 -0
- data/lib/puppeteer/page.rb +1065 -0
- data/lib/puppeteer/page/screenshot_options.rb +78 -0
- data/lib/puppeteer/remote_object.rb +143 -0
- data/lib/puppeteer/target.rb +150 -0
- data/lib/puppeteer/timeout_settings.rb +15 -0
- data/lib/puppeteer/touch_screen.rb +43 -0
- data/lib/puppeteer/version.rb +3 -0
- data/lib/puppeteer/viewport.rb +54 -0
- data/lib/puppeteer/wait_task.rb +188 -0
- data/lib/puppeteer/web_socket.rb +122 -0
- data/lib/puppeteer/web_socket_transport.rb +49 -0
- data/puppeteer-ruby.gemspec +32 -0
- metadata +355 -0
|
@@ -0,0 +1,412 @@
|
|
|
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::WebSocket::DriverImpl
|
|
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::WebSocket::DriverImpl";
|
|
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 (D)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> » <span class='title'><span class='object_link'><a href="../WebSocket.html" title="Puppeteer::WebSocket (class)">WebSocket</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">DriverImpl</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::WebSocket::DriverImpl
|
|
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::WebSocket::DriverImpl</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.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
|
|
105
|
+
<p>providing #url, #write(string)</p>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="tags">
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
118
|
+
<ul class="summary">
|
|
119
|
+
|
|
120
|
+
<li class="public ">
|
|
121
|
+
<span class="summary_signature">
|
|
122
|
+
|
|
123
|
+
<a href="#url-instance_method" title="#url (instance method)">#<strong>url</strong> ⇒ Object </a>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
</span>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<span class="note title readonly">readonly</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
|
143
|
+
<p>Returns the value of attribute url.</p>
|
|
144
|
+
</div></span>
|
|
145
|
+
|
|
146
|
+
</li>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
</ul>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<h2>
|
|
156
|
+
Instance Method Summary
|
|
157
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
158
|
+
</h2>
|
|
159
|
+
|
|
160
|
+
<ul class="summary">
|
|
161
|
+
|
|
162
|
+
<li class="public ">
|
|
163
|
+
<span class="summary_signature">
|
|
164
|
+
|
|
165
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(url) ⇒ DriverImpl </a>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
</span>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
<span class="note title constructor">constructor</span>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
|
182
|
+
<p>A new instance of DriverImpl.</p>
|
|
183
|
+
</div></span>
|
|
184
|
+
|
|
185
|
+
</li>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<li class="public ">
|
|
189
|
+
<span class="summary_signature">
|
|
190
|
+
|
|
191
|
+
<a href="#readpartial-instance_method" title="#readpartial (instance method)">#<strong>readpartial</strong>(maxlen = 1024) ⇒ Object </a>
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</span>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
206
|
+
|
|
207
|
+
</li>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<li class="public ">
|
|
211
|
+
<span class="summary_signature">
|
|
212
|
+
|
|
213
|
+
<a href="#write-instance_method" title="#write (instance method)">#<strong>write</strong>(data) ⇒ Object </a>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
</span>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
228
|
+
|
|
229
|
+
</li>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
</ul>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
<div id="constructor_details" class="method_details_list">
|
|
236
|
+
<h2>Constructor Details</h2>
|
|
237
|
+
|
|
238
|
+
<div class="method_details first">
|
|
239
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
240
|
+
|
|
241
|
+
#<strong>initialize</strong>(url) ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::WebSocket::DriverImpl (class)">DriverImpl</a></span></tt>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
</h3><div class="docstring">
|
|
248
|
+
<div class="discussion">
|
|
249
|
+
|
|
250
|
+
<p>Returns a new instance of DriverImpl.</p>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="tags">
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
</div><table class="source_code">
|
|
259
|
+
<tr>
|
|
260
|
+
<td>
|
|
261
|
+
<pre class="lines">
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
8
|
|
265
|
+
9
|
|
266
|
+
10
|
|
267
|
+
11
|
|
268
|
+
12
|
|
269
|
+
13</pre>
|
|
270
|
+
</td>
|
|
271
|
+
<td>
|
|
272
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 8</span>
|
|
273
|
+
|
|
274
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
|
275
|
+
<span class='ivar'>@url</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span>
|
|
276
|
+
|
|
277
|
+
<span class='id identifier rubyid_endpoint'>endpoint</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
|
278
|
+
<span class='ivar'>@socket</span> <span class='op'>=</span> <span class='const'>TCPSocket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_endpoint'>endpoint</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_endpoint'>endpoint</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='rparen'>)</span>
|
|
279
|
+
<span class='kw'>end</span></pre>
|
|
280
|
+
</td>
|
|
281
|
+
</tr>
|
|
282
|
+
</table>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div id="instance_attr_details" class="attr_details">
|
|
288
|
+
<h2>Instance Attribute Details</h2>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<span id=""></span>
|
|
292
|
+
<div class="method_details first">
|
|
293
|
+
<h3 class="signature first" id="url-instance_method">
|
|
294
|
+
|
|
295
|
+
#<strong>url</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
</h3><div class="docstring">
|
|
302
|
+
<div class="discussion">
|
|
303
|
+
|
|
304
|
+
<p>Returns the value of attribute url.</p>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="tags">
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
</div><table class="source_code">
|
|
313
|
+
<tr>
|
|
314
|
+
<td>
|
|
315
|
+
<pre class="lines">
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
15
|
|
319
|
+
16
|
|
320
|
+
17</pre>
|
|
321
|
+
</td>
|
|
322
|
+
<td>
|
|
323
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 15</span>
|
|
324
|
+
|
|
325
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_url'>url</span>
|
|
326
|
+
<span class='ivar'>@url</span>
|
|
327
|
+
<span class='kw'>end</span></pre>
|
|
328
|
+
</td>
|
|
329
|
+
</tr>
|
|
330
|
+
</table>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<div id="instance_method_details" class="method_details_list">
|
|
337
|
+
<h2>Instance Method Details</h2>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
<div class="method_details first">
|
|
341
|
+
<h3 class="signature first" id="readpartial-instance_method">
|
|
342
|
+
|
|
343
|
+
#<strong>readpartial</strong>(maxlen = 1024) ⇒ <tt>Object</tt>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
</h3><table class="source_code">
|
|
350
|
+
<tr>
|
|
351
|
+
<td>
|
|
352
|
+
<pre class="lines">
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
21
|
|
356
|
+
22
|
|
357
|
+
23</pre>
|
|
358
|
+
</td>
|
|
359
|
+
<td>
|
|
360
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 21</span>
|
|
361
|
+
|
|
362
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_readpartial'>readpartial</span><span class='lparen'>(</span><span class='id identifier rubyid_maxlen'>maxlen</span> <span class='op'>=</span> <span class='int'>1024</span><span class='rparen'>)</span>
|
|
363
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_readpartial'>readpartial</span><span class='lparen'>(</span><span class='id identifier rubyid_maxlen'>maxlen</span><span class='rparen'>)</span>
|
|
364
|
+
<span class='kw'>end</span></pre>
|
|
365
|
+
</td>
|
|
366
|
+
</tr>
|
|
367
|
+
</table>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<div class="method_details ">
|
|
371
|
+
<h3 class="signature " id="write-instance_method">
|
|
372
|
+
|
|
373
|
+
#<strong>write</strong>(data) ⇒ <tt>Object</tt>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
</h3><table class="source_code">
|
|
380
|
+
<tr>
|
|
381
|
+
<td>
|
|
382
|
+
<pre class="lines">
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
17
|
|
386
|
+
18
|
|
387
|
+
19</pre>
|
|
388
|
+
</td>
|
|
389
|
+
<td>
|
|
390
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 17</span>
|
|
391
|
+
|
|
392
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
393
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
394
|
+
<span class='kw'>end</span></pre>
|
|
395
|
+
</td>
|
|
396
|
+
</tr>
|
|
397
|
+
</table>
|
|
398
|
+
</div>
|
|
399
|
+
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
<div id="footer">
|
|
405
|
+
Generated on Fri Jun 12 12:38:34 2020 by
|
|
406
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
407
|
+
0.9.24 (ruby-2.6.3).
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
</div>
|
|
411
|
+
</body>
|
|
412
|
+
</html>
|
|
@@ -0,0 +1,600 @@
|
|
|
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='id identifier rubyid_promise'>promise</span> <span class='op'>=</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>
|
|
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_promise'>promise</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_promise'>promise</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='id identifier rubyid_promise'>promise</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 Fri Jun 12 12:38:35 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>
|