puppeteer-ruby 0.0.4 → 0.0.5
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 +30 -0
- data/.rubocop.yml +4 -5
- data/docs/Puppeteer.html +2010 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2150 -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 +784 -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 +1580 -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 +1603 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +481 -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 +772 -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/Frame.html +3625 -0
- data/docs/Puppeteer/FrameManager.html +2414 -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 +628 -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 +5426 -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 +951 -0
- data/docs/Puppeteer/Target.html +1384 -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 +757 -0
- data/docs/Puppeteer/WaitTask.html +211 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -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 +788 -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 +121 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +121 -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 +3747 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +9 -7
- data/lib/puppeteer/async_await_behavior.rb +6 -0
- data/lib/puppeteer/browser.rb +21 -1
- data/lib/puppeteer/connection.rb +1 -1
- data/lib/puppeteer/dom_world.rb +15 -2
- data/lib/puppeteer/element_handle.rb +3 -2
- data/lib/puppeteer/frame.rb +4 -0
- data/lib/puppeteer/frame_manager.rb +1 -1
- data/lib/puppeteer/js_handle.rb +3 -2
- data/lib/puppeteer/launcher.rb +0 -1
- data/lib/puppeteer/lifecycle_watcher.rb +3 -3
- data/lib/puppeteer/page.rb +6 -4
- data/lib/puppeteer/version.rb +1 -1
- data/puppeteer-ruby.gemspec +4 -1
- metadata +138 -4
@@ -0,0 +1,433 @@
|
|
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
|
+
Module: Puppeteer::EventCallbackable
|
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::EventCallbackable";
|
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 (E)</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">EventCallbackable</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>Module: Puppeteer::EventCallbackable
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>, <span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span>, <span class='object_link'><a href="CDPSession.html" title="Puppeteer::CDPSession (class)">CDPSession</a></span>, <span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span>, <span class='object_link'><a href="FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span>, <span class='object_link'><a href="NetworkManager.html" title="Puppeteer::NetworkManager (class)">NetworkManager</a></span>, <span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/puppeteer/event_callbackable.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<h2>Defined Under Namespace</h2>
|
92
|
+
<p class="children">
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="EventCallbackable/EventListeners.html" title="Puppeteer::EventCallbackable::EventListeners (class)">EventListeners</a></span>
|
98
|
+
|
99
|
+
|
100
|
+
</p>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#add_event_listener-instance_method" title="#add_event_listener (instance method)">#<strong>add_event_listener</strong>(event_name, &block) ⇒ Object </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
134
|
+
|
135
|
+
</li>
|
136
|
+
|
137
|
+
|
138
|
+
<li class="public ">
|
139
|
+
<span class="summary_signature">
|
140
|
+
|
141
|
+
<a href="#emit_event-instance_method" title="#emit_event (instance method)">#<strong>emit_event</strong>(event_name, *args, **kwargs) ⇒ Object </a>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</span>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#on_event-instance_method" title="#on_event (instance method)">#<strong>on_event</strong>(event_name, &block) ⇒ Object </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
178
|
+
|
179
|
+
</li>
|
180
|
+
|
181
|
+
|
182
|
+
<li class="public ">
|
183
|
+
<span class="summary_signature">
|
184
|
+
|
185
|
+
<a href="#remove_event_listener-instance_method" title="#remove_event_listener (instance method)">#<strong>remove_event_listener</strong>(*id_args) ⇒ Object </a>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
</span>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
</ul>
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<div id="instance_method_details" class="method_details_list">
|
210
|
+
<h2>Instance Method Details</h2>
|
211
|
+
|
212
|
+
|
213
|
+
<div class="method_details first">
|
214
|
+
<h3 class="signature first" id="add_event_listener-instance_method">
|
215
|
+
|
216
|
+
#<strong>add_event_listener</strong>(event_name, &block) ⇒ <tt>Object</tt>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</h3><table class="source_code">
|
223
|
+
<tr>
|
224
|
+
<td>
|
225
|
+
<pre class="lines">
|
226
|
+
|
227
|
+
|
228
|
+
29
|
229
|
+
30
|
230
|
+
31
|
231
|
+
32</pre>
|
232
|
+
</td>
|
233
|
+
<td>
|
234
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 29</span>
|
235
|
+
|
236
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
237
|
+
<span class='ivar'>@event_listeners</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
238
|
+
<span class='lparen'>(</span><span class='ivar'>@event_listeners</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="EventCallbackable/EventListeners.html" title="Puppeteer::EventCallbackable::EventListeners (class)">EventListeners</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="EventCallbackable/EventListeners.html#initialize-instance_method" title="Puppeteer::EventCallbackable::EventListeners#initialize (method)">new</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
239
|
+
<span class='kw'>end</span></pre>
|
240
|
+
</td>
|
241
|
+
</tr>
|
242
|
+
</table>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div class="method_details ">
|
246
|
+
<h3 class="signature " id="emit_event-instance_method">
|
247
|
+
|
248
|
+
#<strong>emit_event</strong>(event_name, *args, **kwargs) ⇒ <tt>Object</tt>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</h3><table class="source_code">
|
255
|
+
<tr>
|
256
|
+
<td>
|
257
|
+
<pre class="lines">
|
258
|
+
|
259
|
+
|
260
|
+
47
|
261
|
+
48
|
262
|
+
49
|
263
|
+
50
|
264
|
+
51
|
265
|
+
52
|
266
|
+
53
|
267
|
+
54
|
268
|
+
55
|
269
|
+
56
|
270
|
+
57
|
271
|
+
58
|
272
|
+
59
|
273
|
+
60
|
274
|
+
61
|
275
|
+
62
|
276
|
+
63
|
277
|
+
64
|
278
|
+
65
|
279
|
+
66
|
280
|
+
67
|
281
|
+
68
|
282
|
+
69
|
283
|
+
70
|
284
|
+
71
|
285
|
+
72
|
286
|
+
73
|
287
|
+
74
|
288
|
+
75
|
289
|
+
76
|
290
|
+
77
|
291
|
+
78
|
292
|
+
79
|
293
|
+
80
|
294
|
+
81
|
295
|
+
82
|
296
|
+
83
|
297
|
+
84
|
298
|
+
85
|
299
|
+
86
|
300
|
+
87</pre>
|
301
|
+
</td>
|
302
|
+
<td>
|
303
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 47</span>
|
304
|
+
|
305
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_emit_event'>emit_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
|
306
|
+
<span class='ivar'>@event_callbackable_handlers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
307
|
+
<span class='ivar'>@event_listeners</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
308
|
+
|
309
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
310
|
+
<span class='comment'># In Ruby's specification (version < 2.7),
|
311
|
+
</span> <span class='comment'># `method(:x).call(*args, **kwargs)` is equivalent to `x(*args, {})`
|
312
|
+
</span> <span class='comment'># It often causes unexpected ArgumentError.
|
313
|
+
</span> <span class='comment'>#
|
314
|
+
</span> <span class='comment'># ----------------
|
315
|
+
</span> <span class='comment'># def greet
|
316
|
+
</span> <span class='comment'># puts 'Hello!'
|
317
|
+
</span> <span class='comment'># end
|
318
|
+
</span> <span class='comment'>#
|
319
|
+
</span> <span class='comment'># def call_me(*args, **kwargs)
|
320
|
+
</span> <span class='comment'># greet(*args, **kwargs) # => 'Hello!'
|
321
|
+
</span> <span class='comment'>#
|
322
|
+
</span> <span class='comment'># method(:greet).call(*args, **kwargs) # => `greet': wrong number of arguments (given 1, expected 0) (ArgumentError)
|
323
|
+
</span> <span class='comment'># end
|
324
|
+
</span> <span class='comment'>#
|
325
|
+
</span> <span class='comment'># call_me
|
326
|
+
</span> <span class='comment'># ----------------
|
327
|
+
</span> <span class='comment'>#
|
328
|
+
</span> <span class='comment'># This behavior is really annoying, and should be avoided, because we often want to set event handler as below:
|
329
|
+
</span> <span class='comment'>#
|
330
|
+
</span> <span class='comment'># `on_event 'Some.Event.awesome', &method(:handle_awesome_event)`
|
331
|
+
</span> <span class='comment'>#
|
332
|
+
</span> <span class='comment'># So Let's avoid it by checking kwargs.
|
333
|
+
</span> <span class='ivar'>@event_callbackable_handlers</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
334
|
+
<span class='ivar'>@event_listeners</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_proc'>proc</span><span class='op'>|</span>
|
335
|
+
<span class='id identifier rubyid_proc'>proc</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
336
|
+
<span class='kw'>end</span>
|
337
|
+
<span class='kw'>else</span>
|
338
|
+
<span class='ivar'>@event_callbackable_handlers</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
|
339
|
+
<span class='ivar'>@event_listeners</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_proc'>proc</span><span class='op'>|</span>
|
340
|
+
<span class='id identifier rubyid_proc'>proc</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
|
341
|
+
<span class='kw'>end</span>
|
342
|
+
<span class='kw'>end</span>
|
343
|
+
|
344
|
+
<span class='id identifier rubyid_event_name'>event_name</span>
|
345
|
+
<span class='kw'>end</span></pre>
|
346
|
+
</td>
|
347
|
+
</tr>
|
348
|
+
</table>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="method_details ">
|
352
|
+
<h3 class="signature " id="on_event-instance_method">
|
353
|
+
|
354
|
+
#<strong>on_event</strong>(event_name, &block) ⇒ <tt>Object</tt>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
</h3><table class="source_code">
|
361
|
+
<tr>
|
362
|
+
<td>
|
363
|
+
<pre class="lines">
|
364
|
+
|
365
|
+
|
366
|
+
42
|
367
|
+
43
|
368
|
+
44
|
369
|
+
45</pre>
|
370
|
+
</td>
|
371
|
+
<td>
|
372
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 42</span>
|
373
|
+
|
374
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_event'>on_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
375
|
+
<span class='ivar'>@event_callbackable_handlers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
376
|
+
<span class='ivar'>@event_callbackable_handlers</span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
377
|
+
<span class='kw'>end</span></pre>
|
378
|
+
</td>
|
379
|
+
</tr>
|
380
|
+
</table>
|
381
|
+
</div>
|
382
|
+
|
383
|
+
<div class="method_details ">
|
384
|
+
<h3 class="signature " id="remove_event_listener-instance_method">
|
385
|
+
|
386
|
+
#<strong>remove_event_listener</strong>(*id_args) ⇒ <tt>Object</tt>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
</h3><table class="source_code">
|
393
|
+
<tr>
|
394
|
+
<td>
|
395
|
+
<pre class="lines">
|
396
|
+
|
397
|
+
|
398
|
+
34
|
399
|
+
35
|
400
|
+
36
|
401
|
+
37
|
402
|
+
38
|
403
|
+
39
|
404
|
+
40</pre>
|
405
|
+
</td>
|
406
|
+
<td>
|
407
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 34</span>
|
408
|
+
|
409
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_event_listener'>remove_event_listener</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_id_args'>id_args</span><span class='rparen'>)</span>
|
410
|
+
<span class='lparen'>(</span><span class='ivar'>@event_listeners</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='id identifier rubyid_listeners'>listeners</span><span class='op'>|</span>
|
411
|
+
<span class='id identifier rubyid_id_args'>id_args</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='op'>|</span>
|
412
|
+
<span class='id identifier rubyid_listeners'>listeners</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
413
|
+
<span class='kw'>end</span>
|
414
|
+
<span class='kw'>end</span>
|
415
|
+
<span class='kw'>end</span></pre>
|
416
|
+
</td>
|
417
|
+
</tr>
|
418
|
+
</table>
|
419
|
+
</div>
|
420
|
+
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
<div id="footer">
|
426
|
+
Generated on Sun Apr 26 15:52:55 2020 by
|
427
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
428
|
+
0.9.24 (ruby-2.6.3).
|
429
|
+
</div>
|
430
|
+
|
431
|
+
</div>
|
432
|
+
</body>
|
433
|
+
</html>
|
@@ -0,0 +1,435 @@
|
|
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::EventCallbackable::EventListeners
|
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::EventCallbackable::EventListeners";
|
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 (E)</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="../EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">EventListeners</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::EventCallbackable::EventListeners
|
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::EventCallbackable::EventListeners</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd>Enumerable</dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/puppeteer/event_callbackable.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<h2>
|
116
|
+
Instance Method Summary
|
117
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
118
|
+
</h2>
|
119
|
+
|
120
|
+
<ul class="summary">
|
121
|
+
|
122
|
+
<li class="public ">
|
123
|
+
<span class="summary_signature">
|
124
|
+
|
125
|
+
<a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(&block) ⇒ String </a>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
</span>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<span class="summary_desc"><div class='inline'>
|
140
|
+
<p>Listener ID.</p>
|
141
|
+
</div></span>
|
142
|
+
|
143
|
+
</li>
|
144
|
+
|
145
|
+
|
146
|
+
<li class="public ">
|
147
|
+
<span class="summary_signature">
|
148
|
+
|
149
|
+
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(id) ⇒ Object </a>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
</span>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong>(&block) ⇒ Object </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
186
|
+
|
187
|
+
</li>
|
188
|
+
|
189
|
+
|
190
|
+
<li class="public ">
|
191
|
+
<span class="summary_signature">
|
192
|
+
|
193
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ EventListeners </a>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</span>
|
198
|
+
|
199
|
+
|
200
|
+
<span class="note title constructor">constructor</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<span class="summary_desc"><div class='inline'>
|
210
|
+
<p>A new instance of EventListeners.</p>
|
211
|
+
</div></span>
|
212
|
+
|
213
|
+
</li>
|
214
|
+
|
215
|
+
|
216
|
+
</ul>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<div id="constructor_details" class="method_details_list">
|
221
|
+
<h2>Constructor Details</h2>
|
222
|
+
|
223
|
+
<div class="method_details first">
|
224
|
+
<h3 class="signature first" id="initialize-instance_method">
|
225
|
+
|
226
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::EventCallbackable::EventListeners (class)">EventListeners</a></span></tt>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
</h3><div class="docstring">
|
233
|
+
<div class="discussion">
|
234
|
+
|
235
|
+
<p>Returns a new instance of EventListeners.</p>
|
236
|
+
|
237
|
+
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
<div class="tags">
|
241
|
+
|
242
|
+
|
243
|
+
</div><table class="source_code">
|
244
|
+
<tr>
|
245
|
+
<td>
|
246
|
+
<pre class="lines">
|
247
|
+
|
248
|
+
|
249
|
+
7
|
250
|
+
8
|
251
|
+
9</pre>
|
252
|
+
</td>
|
253
|
+
<td>
|
254
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 7</span>
|
255
|
+
|
256
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
257
|
+
<span class='ivar'>@listeners</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
258
|
+
<span class='kw'>end</span></pre>
|
259
|
+
</td>
|
260
|
+
</tr>
|
261
|
+
</table>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
<div id="instance_method_details" class="method_details_list">
|
268
|
+
<h2>Instance Method Details</h2>
|
269
|
+
|
270
|
+
|
271
|
+
<div class="method_details first">
|
272
|
+
<h3 class="signature first" id="add-instance_method">
|
273
|
+
|
274
|
+
#<strong>add</strong>(&block) ⇒ <tt>String</tt>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
</h3><div class="docstring">
|
281
|
+
<div class="discussion">
|
282
|
+
|
283
|
+
<p>Returns Listener ID.</p>
|
284
|
+
|
285
|
+
|
286
|
+
</div>
|
287
|
+
</div>
|
288
|
+
<div class="tags">
|
289
|
+
|
290
|
+
<p class="tag_title">Returns:</p>
|
291
|
+
<ul class="return">
|
292
|
+
|
293
|
+
<li>
|
294
|
+
|
295
|
+
|
296
|
+
<span class='type'>(<tt>String</tt>)</span>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
—
|
301
|
+
<div class='inline'>
|
302
|
+
<p>Listener ID</p>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</li>
|
306
|
+
|
307
|
+
</ul>
|
308
|
+
|
309
|
+
</div><table class="source_code">
|
310
|
+
<tr>
|
311
|
+
<td>
|
312
|
+
<pre class="lines">
|
313
|
+
|
314
|
+
|
315
|
+
12
|
316
|
+
13
|
317
|
+
14
|
318
|
+
15
|
319
|
+
16</pre>
|
320
|
+
</td>
|
321
|
+
<td>
|
322
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 12</span>
|
323
|
+
|
324
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
325
|
+
<span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='const'>SecureRandom</span><span class='period'>.</span><span class='id identifier rubyid_hex'>hex</span><span class='lparen'>(</span><span class='int'>8</span><span class='rparen'>)</span>
|
326
|
+
<span class='ivar'>@listeners</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
327
|
+
<span class='id identifier rubyid_id'>id</span>
|
328
|
+
<span class='kw'>end</span></pre>
|
329
|
+
</td>
|
330
|
+
</tr>
|
331
|
+
</table>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div class="method_details ">
|
335
|
+
<h3 class="signature " id="delete-instance_method">
|
336
|
+
|
337
|
+
#<strong>delete</strong>(id) ⇒ <tt>Object</tt>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
</h3><div class="docstring">
|
344
|
+
<div class="discussion">
|
345
|
+
|
346
|
+
|
347
|
+
</div>
|
348
|
+
</div>
|
349
|
+
<div class="tags">
|
350
|
+
<p class="tag_title">Parameters:</p>
|
351
|
+
<ul class="param">
|
352
|
+
|
353
|
+
<li>
|
354
|
+
|
355
|
+
<span class='name'>id</span>
|
356
|
+
|
357
|
+
|
358
|
+
<span class='type'>(<tt>String</tt>)</span>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
—
|
363
|
+
<div class='inline'>
|
364
|
+
<p>Listener ID returned on #add</p>
|
365
|
+
</div>
|
366
|
+
|
367
|
+
</li>
|
368
|
+
|
369
|
+
</ul>
|
370
|
+
|
371
|
+
|
372
|
+
</div><table class="source_code">
|
373
|
+
<tr>
|
374
|
+
<td>
|
375
|
+
<pre class="lines">
|
376
|
+
|
377
|
+
|
378
|
+
19
|
379
|
+
20
|
380
|
+
21</pre>
|
381
|
+
</td>
|
382
|
+
<td>
|
383
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 19</span>
|
384
|
+
|
385
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
386
|
+
<span class='ivar'>@listeners</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
387
|
+
<span class='kw'>end</span></pre>
|
388
|
+
</td>
|
389
|
+
</tr>
|
390
|
+
</table>
|
391
|
+
</div>
|
392
|
+
|
393
|
+
<div class="method_details ">
|
394
|
+
<h3 class="signature " id="each-instance_method">
|
395
|
+
|
396
|
+
#<strong>each</strong>(&block) ⇒ <tt>Object</tt>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</h3><table class="source_code">
|
403
|
+
<tr>
|
404
|
+
<td>
|
405
|
+
<pre class="lines">
|
406
|
+
|
407
|
+
|
408
|
+
24
|
409
|
+
25
|
410
|
+
26</pre>
|
411
|
+
</td>
|
412
|
+
<td>
|
413
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/event_callbackable.rb', line 24</span>
|
414
|
+
|
415
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
416
|
+
<span class='ivar'>@listeners</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
417
|
+
<span class='kw'>end</span></pre>
|
418
|
+
</td>
|
419
|
+
</tr>
|
420
|
+
</table>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
<div id="footer">
|
428
|
+
Generated on Sun Apr 26 15:52:58 2020 by
|
429
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
430
|
+
0.9.24 (ruby-2.6.3).
|
431
|
+
</div>
|
432
|
+
|
433
|
+
</div>
|
434
|
+
</body>
|
435
|
+
</html>
|