ovto 0.5.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/CHANGELOG.md +14 -2
- data/Gemfile +2 -3
- data/Gemfile.lock +23 -27
- data/book/SUMMARY.md +2 -0
- data/book/api/actions.md +1 -1
- data/book/api/middleware.md +99 -0
- data/book/api/pure_component.md +3 -0
- data/docs/api/Array.html +190 -0
- data/docs/api/Hash.html +196 -0
- data/docs/api/Ovto/Actions.html +128 -40
- data/docs/api/Ovto/App.html +254 -40
- data/docs/api/Ovto/Component/MoreThanOneNode.html +6 -6
- data/docs/api/Ovto/Component.html +96 -29
- data/docs/api/Ovto/Middleware/Actions.html +428 -0
- data/docs/api/Ovto/Middleware/Base.html +605 -0
- data/docs/api/Ovto/Middleware/Component.html +354 -0
- data/docs/api/Ovto/Middleware.html +286 -0
- data/docs/api/Ovto/PureComponent/StateIsNotAvailable.html +6 -6
- data/docs/api/Ovto/PureComponent.html +11 -11
- data/docs/api/Ovto/Runtime.html +7 -7
- data/docs/api/Ovto/State/MissingValue.html +6 -6
- data/docs/api/Ovto/State/{UnknownKey.html → UnknownStateKey.html} +11 -11
- data/docs/api/Ovto/State.html +59 -43
- data/docs/api/Ovto/WiredActionSet.html +636 -0
- data/docs/api/Ovto/WiredActions.html +78 -35
- data/docs/api/Ovto.html +223 -30
- data/docs/api/_index.html +77 -11
- data/docs/api/actions.html +29 -3
- data/docs/api/app.html +28 -2
- data/docs/api/class_list.html +3 -3
- data/docs/api/component.html +30 -4
- data/docs/api/css/style.css +3 -2
- data/docs/api/fetch.html +30 -4
- data/docs/api/file.README.html +76 -78
- data/docs/api/file_list.html +2 -2
- data/docs/api/frames.html +2 -2
- data/docs/api/index.html +76 -78
- data/docs/api/js/app.js +14 -3
- data/docs/api/method_list.html +303 -31
- data/docs/api/middleware.html +498 -0
- data/docs/api/pure_component.html +428 -0
- data/docs/api/state.html +28 -2
- data/docs/api/top-level-namespace.html +11 -9
- data/docs/guides/debugging.html +28 -2
- data/docs/guides/development.html +28 -2
- data/docs/guides/install.html +28 -2
- data/docs/guides/tutorial.html +28 -2
- data/docs/index.html +28 -2
- data/docs/search_index.json +1 -1
- data/examples/sinatra/Gemfile +2 -0
- data/examples/sinatra/Gemfile.lock +32 -30
- data/examples/sinatra/app.rb +1 -4
- data/examples/sinatra/config.ru +6 -6
- data/examples/static/Gemfile.lock +9 -9
- data/lib/ovto/actions.rb +11 -0
- data/lib/ovto/app.rb +37 -13
- data/lib/ovto/component.rb +130 -67
- data/lib/ovto/middleware.rb +121 -0
- data/lib/ovto/pure_component.rb +1 -1
- data/lib/ovto/state.rb +13 -5
- data/lib/ovto/version.rb +1 -1
- data/lib/ovto/wired_action_set.rb +40 -0
- data/lib/ovto/wired_actions.rb +49 -11
- data/lib/ovto.rb +26 -0
- data/ovto.gemspec +1 -1
- metadata +21 -11
- data/docs/api/pure_component.md +0 -27
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ovto::WiredActions
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "Ovto::WiredActions";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -141,7 +141,7 @@
|
|
141
141
|
<li class="public ">
|
142
142
|
<span class="summary_signature">
|
143
143
|
|
144
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(actions, app, runtime) ⇒ WiredActions </a>
|
144
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(actions, app, runtime, parent) ⇒ WiredActions </a>
|
145
145
|
|
146
146
|
|
147
147
|
|
@@ -158,7 +158,7 @@
|
|
158
158
|
|
159
159
|
|
160
160
|
<span class="summary_desc"><div class='inline'>
|
161
|
-
<p>
|
161
|
+
<p>Create a WiredActions.</p>
|
162
162
|
</div></span>
|
163
163
|
|
164
164
|
</li>
|
@@ -217,7 +217,7 @@
|
|
217
217
|
<div class="method_details first">
|
218
218
|
<h3 class="signature first" id="initialize-instance_method">
|
219
219
|
|
220
|
-
#<strong>initialize</strong>(actions, app, runtime) ⇒ <tt><span class='object_link'><a href="" title="Ovto::WiredActions (class)">WiredActions</a></span></tt>
|
220
|
+
#<strong>initialize</strong>(actions, app, runtime, parent) ⇒ <tt><span class='object_link'><a href="" title="Ovto::WiredActions (class)">WiredActions</a></span></tt>
|
221
221
|
|
222
222
|
|
223
223
|
|
@@ -226,7 +226,16 @@
|
|
226
226
|
</h3><div class="docstring">
|
227
227
|
<div class="discussion">
|
228
228
|
|
229
|
-
<p>
|
229
|
+
<p>Create a WiredActions</p>
|
230
|
+
<ul><li>
|
231
|
+
<p>actions: Ovto::Actions</p>
|
232
|
+
</li><li>
|
233
|
+
<p>app: Ovto::App</p>
|
234
|
+
</li><li>
|
235
|
+
<p>runtime: Ovto::Runtime (to call scheduleRender after state change)</p>
|
236
|
+
</li><li>
|
237
|
+
<p>parent: WiredActionSet</p>
|
238
|
+
</li></ul>
|
230
239
|
|
231
240
|
|
232
241
|
</div>
|
@@ -240,15 +249,15 @@
|
|
240
249
|
<pre class="lines">
|
241
250
|
|
242
251
|
|
243
|
-
|
244
|
-
|
245
|
-
|
252
|
+
12
|
253
|
+
13
|
254
|
+
14</pre>
|
246
255
|
</td>
|
247
256
|
<td>
|
248
|
-
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line
|
257
|
+
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line 12</span>
|
249
258
|
|
250
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_actions'>actions</span><span class='comma'>,</span> <span class='id identifier rubyid_app'>app</span><span class='comma'>,</span> <span class='id identifier rubyid_runtime'>runtime</span><span class='rparen'>)</span>
|
251
|
-
<span class='ivar'>@actions</span><span class='comma'>,</span> <span class='ivar'>@app</span><span class='comma'>,</span> <span class='ivar'>@runtime</span> <span class='op'>=</span> <span class='id identifier rubyid_actions'>actions</span><span class='comma'>,</span> <span class='id identifier rubyid_app'>app</span><span class='comma'>,</span> <span class='id identifier rubyid_runtime'>runtime</span>
|
259
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_actions'>actions</span><span class='comma'>,</span> <span class='id identifier rubyid_app'>app</span><span class='comma'>,</span> <span class='id identifier rubyid_runtime'>runtime</span><span class='comma'>,</span> <span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
|
260
|
+
<span class='ivar'>@actions</span><span class='comma'>,</span> <span class='ivar'>@app</span><span class='comma'>,</span> <span class='ivar'>@runtime</span><span class='comma'>,</span> <span class='ivar'>@parent</span> <span class='op'>=</span> <span class='id identifier rubyid_actions'>actions</span><span class='comma'>,</span> <span class='id identifier rubyid_app'>app</span><span class='comma'>,</span> <span class='id identifier rubyid_runtime'>runtime</span><span class='comma'>,</span> <span class='id identifier rubyid_parent'>parent</span>
|
252
261
|
<span class='kw'>end</span></pre>
|
253
262
|
</td>
|
254
263
|
</tr>
|
@@ -272,25 +281,59 @@
|
|
272
281
|
|
273
282
|
|
274
283
|
|
275
|
-
</h3><
|
284
|
+
</h3><div class="docstring">
|
285
|
+
<div class="discussion">
|
286
|
+
|
287
|
+
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
<div class="tags">
|
291
|
+
|
292
|
+
<p class="tag_title">Raises:</p>
|
293
|
+
<ul class="raise">
|
294
|
+
|
295
|
+
<li>
|
296
|
+
|
297
|
+
|
298
|
+
<span class='type'>(<tt>NoMethodError</tt>)</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
</li>
|
303
|
+
|
304
|
+
</ul>
|
305
|
+
|
306
|
+
</div><table class="source_code">
|
276
307
|
<tr>
|
277
308
|
<td>
|
278
309
|
<pre class="lines">
|
279
310
|
|
280
311
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
312
|
+
16
|
313
|
+
17
|
314
|
+
18
|
315
|
+
19
|
316
|
+
20
|
317
|
+
21
|
318
|
+
22
|
319
|
+
23
|
320
|
+
24
|
321
|
+
25
|
322
|
+
26</pre>
|
286
323
|
</td>
|
287
324
|
<td>
|
288
|
-
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line 16</span>
|
289
326
|
|
290
327
|
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_args_hash'>args_hash</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
291
|
-
<span class='const'><span class='
|
292
|
-
|
293
|
-
|
328
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>NoMethodError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>undefined method `</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>' on </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
329
|
+
<span class='kw'>if</span> <span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
330
|
+
<span class='const'><span class='object_link'><a href="../Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='period'>.</span><span class='id identifier rubyid_log_error'><span class='object_link'><a href="../Ovto.html#log_error-class_method" title="Ovto.log_error (method)">log_error</a></span></span> <span class='lbrace'>{</span>
|
331
|
+
<span class='const'><span class='object_link'><a href="../Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='period'>.</span><span class='id identifier rubyid_debug_trace_log'><span class='object_link'><a href="../Ovto.html#debug_trace_log-class_method" title="Ovto.debug_trace_log (method)">debug_trace_log</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invoke action \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" on </span><span class='embexpr_beg'>#{</span><span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
332
|
+
<span class='id identifier rubyid_invoke_action'>invoke_action</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_args_hash'>args_hash</span><span class='rparen'>)</span>
|
333
|
+
<span class='rbrace'>}</span>
|
334
|
+
<span class='kw'>else</span>
|
335
|
+
<span class='ivar'>@parent</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="WiredActionSet.html" title="Ovto::WiredActionSet (class)">WiredActionSet</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="WiredActionSet.html#THE_MIDDLEWARE_ITSELF-constant" title="Ovto::WiredActionSet::THE_MIDDLEWARE_ITSELF (constant)">THE_MIDDLEWARE_ITSELF</a></span></span><span class='rbracket'>]</span> <span class='comment'># WiredActions of a middleware named `name`
|
336
|
+
</span> <span class='kw'>end</span>
|
294
337
|
<span class='kw'>end</span></pre>
|
295
338
|
</td>
|
296
339
|
</tr>
|
@@ -330,12 +373,12 @@
|
|
330
373
|
<pre class="lines">
|
331
374
|
|
332
375
|
|
333
|
-
|
334
|
-
|
335
|
-
|
376
|
+
33
|
377
|
+
34
|
378
|
+
35</pre>
|
336
379
|
</td>
|
337
380
|
<td>
|
338
|
-
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line
|
381
|
+
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line 33</span>
|
339
382
|
|
340
383
|
<span class='kw'>def</span> <span class='id identifier rubyid__app'>_app</span>
|
341
384
|
<span class='ivar'>@app</span>
|
@@ -382,15 +425,15 @@
|
|
382
425
|
<pre class="lines">
|
383
426
|
|
384
427
|
|
385
|
-
|
386
|
-
|
387
|
-
|
428
|
+
28
|
429
|
+
29
|
430
|
+
30</pre>
|
388
431
|
</td>
|
389
432
|
<td>
|
390
|
-
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line
|
433
|
+
<pre class="code"><span class="info file"># File 'lib/ovto/wired_actions.rb', line 28</span>
|
391
434
|
|
392
435
|
<span class='kw'>def</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
393
|
-
<span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
436
|
+
<span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='ivar'>@parent</span><span class='period'>.</span><span class='id identifier rubyid_middleware_names'>middleware_names</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
394
437
|
<span class='kw'>end</span></pre>
|
395
438
|
</td>
|
396
439
|
</tr>
|
@@ -402,9 +445,9 @@
|
|
402
445
|
</div>
|
403
446
|
|
404
447
|
<div id="footer">
|
405
|
-
Generated on
|
448
|
+
Generated on Fri Oct 22 08:18:18 2021 by
|
406
449
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
407
|
-
0.9.
|
450
|
+
0.9.26 (ruby-3.0.2).
|
408
451
|
</div>
|
409
452
|
|
410
453
|
</div>
|
data/docs/api/Ovto.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ovto
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "Ovto";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -79,7 +79,7 @@
|
|
79
79
|
<dl>
|
80
80
|
<dt>Defined in:</dt>
|
81
81
|
<dd>lib/ovto.rb<span class="defines">,<br />
|
82
|
-
lib/ovto/app.rb,<br /> lib/ovto/fetch.rb,<br /> lib/ovto/state.rb,<br /> lib/ovto/actions.rb,<br /> lib/ovto/runtime.rb,<br /> lib/ovto/version.rb,<br /> lib/ovto/component.rb,<br /> lib/ovto/wired_actions.rb,<br /> lib/ovto/pure_component.rb</span>
|
82
|
+
lib/ovto/app.rb,<br /> lib/ovto/fetch.rb,<br /> lib/ovto/state.rb,<br /> lib/ovto/actions.rb,<br /> lib/ovto/runtime.rb,<br /> lib/ovto/version.rb,<br /> lib/ovto/component.rb,<br /> lib/ovto/middleware.rb,<br /> lib/ovto/wired_actions.rb,<br /> lib/ovto/pure_component.rb,<br /> lib/ovto/wired_action_set.rb</span>
|
83
83
|
</dd>
|
84
84
|
</dl>
|
85
85
|
|
@@ -89,9 +89,11 @@
|
|
89
89
|
<p class="children">
|
90
90
|
|
91
91
|
|
92
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Ovto/Middleware.html" title="Ovto::Middleware (module)">Middleware</a></span>
|
93
|
+
|
92
94
|
|
93
95
|
|
94
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Ovto/Actions.html" title="Ovto::Actions (class)">Actions</a></span>, <span class='object_link'><a href="Ovto/App.html" title="Ovto::App (class)">App</a></span>, <span class='object_link'><a href="Ovto/Component.html" title="Ovto::Component (class)">Component</a></span>, <span class='object_link'><a href="Ovto/PureComponent.html" title="Ovto::PureComponent (class)">PureComponent</a></span>, <span class='object_link'><a href="Ovto/Runtime.html" title="Ovto::Runtime (class)">Runtime</a></span>, <span class='object_link'><a href="Ovto/State.html" title="Ovto::State (class)">State</a></span>, <span class='object_link'><a href="Ovto/WiredActions.html" title="Ovto::WiredActions (class)">WiredActions</a></span>
|
96
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Ovto/Actions.html" title="Ovto::Actions (class)">Actions</a></span>, <span class='object_link'><a href="Ovto/App.html" title="Ovto::App (class)">App</a></span>, <span class='object_link'><a href="Ovto/Component.html" title="Ovto::Component (class)">Component</a></span>, <span class='object_link'><a href="Ovto/PureComponent.html" title="Ovto::PureComponent (class)">PureComponent</a></span>, <span class='object_link'><a href="Ovto/Runtime.html" title="Ovto::Runtime (class)">Runtime</a></span>, <span class='object_link'><a href="Ovto/State.html" title="Ovto::State (class)">State</a></span>, <span class='object_link'><a href="Ovto/WiredActionSet.html" title="Ovto::WiredActionSet (class)">WiredActionSet</a></span>, <span class='object_link'><a href="Ovto/WiredActions.html" title="Ovto::WiredActions (class)">WiredActions</a></span>
|
95
97
|
|
96
98
|
|
97
99
|
</p>
|
@@ -107,7 +109,12 @@
|
|
107
109
|
<dt id="VERSION-constant" class="">VERSION =
|
108
110
|
|
109
111
|
</dt>
|
110
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.
|
112
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.6.1</span><span class='tstring_end'>'</span></span></pre></dd>
|
113
|
+
|
114
|
+
<dt id="VALID_NAME_REXP-constant" class="">VALID_NAME_REXP =
|
115
|
+
|
116
|
+
</dt>
|
117
|
+
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[a-zA-Z0-9_]+\z</span><span class='regexp_end'>/</span></span></pre></dd>
|
111
118
|
|
112
119
|
</dl>
|
113
120
|
|
@@ -285,6 +292,54 @@
|
|
285
292
|
<p>Call block.</p>
|
286
293
|
</div></span>
|
287
294
|
|
295
|
+
</li>
|
296
|
+
|
297
|
+
|
298
|
+
<li class="public ">
|
299
|
+
<span class="summary_signature">
|
300
|
+
|
301
|
+
<a href="#Middleware-class_method" title="Middleware (class method)">.<strong>Middleware</strong>(name) ⇒ Object </a>
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
</span>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<span class="summary_desc"><div class='inline'>
|
316
|
+
<p>Create an ancestor of middleware class Example: class MiddlewareExample < Ovto::Middleware(“middleware_example”).</p>
|
317
|
+
</div></span>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
|
322
|
+
<li class="public ">
|
323
|
+
<span class="summary_signature">
|
324
|
+
|
325
|
+
<a href="#send_args_with_state-class_method" title="send_args_with_state (class method)">.<strong>send_args_with_state</strong>(obj, meth, args, state, &block) ⇒ Object </a>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
<span class="summary_desc"><div class='inline'>
|
340
|
+
<p>Something like `obj.meth(state: state, **args, &block)` Safe even if `obj.meth` does not have `state:`.</p>
|
341
|
+
</div></span>
|
342
|
+
|
288
343
|
</li>
|
289
344
|
|
290
345
|
|
@@ -385,10 +440,10 @@
|
|
385
440
|
<pre class="lines">
|
386
441
|
|
387
442
|
|
388
|
-
|
443
|
+
23</pre>
|
389
444
|
</td>
|
390
445
|
<td>
|
391
|
-
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line
|
446
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 23</span>
|
392
447
|
|
393
448
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_debug_trace'>debug_trace</span><span class='semicolon'>;</span> <span class='ivar'>@debug_trace</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
394
449
|
</td>
|
@@ -411,10 +466,10 @@
|
|
411
466
|
<pre class="lines">
|
412
467
|
|
413
468
|
|
414
|
-
|
469
|
+
24</pre>
|
415
470
|
</td>
|
416
471
|
<td>
|
417
|
-
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line
|
472
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 24</span>
|
418
473
|
|
419
474
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_debug_trace='>debug_trace=</span><span class='lparen'>(</span><span class='id identifier rubyid_bool'>bool</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='ivar'>@debug_trace</span> <span class='op'>=</span> <span class='id identifier rubyid_bool'>bool</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
420
475
|
</td>
|
@@ -437,12 +492,12 @@
|
|
437
492
|
<pre class="lines">
|
438
493
|
|
439
494
|
|
440
|
-
|
441
|
-
|
442
|
-
|
495
|
+
25
|
496
|
+
26
|
497
|
+
27</pre>
|
443
498
|
</td>
|
444
499
|
<td>
|
445
|
-
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line
|
500
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 25</span>
|
446
501
|
|
447
502
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_debug_trace_log'>debug_trace_log</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span>
|
448
503
|
<span class='id identifier rubyid_console'><span class='object_link'><a href="top-level-namespace.html#console-instance_method" title="#console (method)">console</a></span></span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Ovto: </span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@debug_trace</span>
|
@@ -556,16 +611,16 @@
|
|
556
611
|
<pre class="lines">
|
557
612
|
|
558
613
|
|
559
|
-
27
|
560
|
-
28
|
561
|
-
29
|
562
614
|
30
|
563
615
|
31
|
564
616
|
32
|
565
|
-
33
|
617
|
+
33
|
618
|
+
34
|
619
|
+
35
|
620
|
+
36</pre>
|
566
621
|
</td>
|
567
622
|
<td>
|
568
|
-
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line
|
623
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 30</span>
|
569
624
|
|
570
625
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
|
571
626
|
<span class='kw'>if</span> <span class='backtick'>`</span><span class='tstring_content'>obj.$inspect</span><span class='tstring_end'>`</span></span>
|
@@ -591,8 +646,7 @@
|
|
591
646
|
</h3><div class="docstring">
|
592
647
|
<div class="discussion">
|
593
648
|
|
594
|
-
<p>Call block. If an exception is raised and there is a tag with
|
595
|
-
`id='ovto-debug'`, describe the error in that tag</p>
|
649
|
+
<p>Call block. If an exception is raised and there is a tag with `id='ovto-debug'`, describe the error in that tag</p>
|
596
650
|
|
597
651
|
|
598
652
|
</div>
|
@@ -606,9 +660,6 @@
|
|
606
660
|
<pre class="lines">
|
607
661
|
|
608
662
|
|
609
|
-
37
|
610
|
-
38
|
611
|
-
39
|
612
663
|
40
|
613
664
|
41
|
614
665
|
42
|
@@ -627,10 +678,13 @@
|
|
627
678
|
55
|
628
679
|
56
|
629
680
|
57
|
630
|
-
58
|
681
|
+
58
|
682
|
+
59
|
683
|
+
60
|
684
|
+
61</pre>
|
631
685
|
</td>
|
632
686
|
<td>
|
633
|
-
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line
|
687
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 40</span>
|
634
688
|
|
635
689
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_log_error'>log_error</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
636
690
|
<span class='kw'>return</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
|
@@ -643,7 +697,7 @@
|
|
643
697
|
div.textContent = "ERROR: " + </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
|
644
698
|
var ul = document.createElement('ul');
|
645
699
|
// Note: ex.backtrace may be an Array or a String
|
646
|
-
</span><span class='embexpr_beg'>#{</span><span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>.forEach(function(line){
|
700
|
+
</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>.forEach(function(line){
|
647
701
|
var li = document.createElement('li');
|
648
702
|
li.textContent = line;
|
649
703
|
ul.appendChild(li);
|
@@ -657,6 +711,145 @@
|
|
657
711
|
</td>
|
658
712
|
</tr>
|
659
713
|
</table>
|
714
|
+
</div>
|
715
|
+
|
716
|
+
<div class="method_details ">
|
717
|
+
<h3 class="signature " id="Middleware-class_method">
|
718
|
+
|
719
|
+
.<strong>Middleware</strong>(name) ⇒ <tt>Object</tt>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
</h3><div class="docstring">
|
726
|
+
<div class="discussion">
|
727
|
+
|
728
|
+
<p>Create an ancestor of middleware class Example:</p>
|
729
|
+
|
730
|
+
<pre class="code ruby"><code class="ruby">class MiddlewareExample < Ovto::Middleware("middleware_example")
|
731
|
+
</code></pre>
|
732
|
+
|
733
|
+
|
734
|
+
</div>
|
735
|
+
</div>
|
736
|
+
<div class="tags">
|
737
|
+
|
738
|
+
|
739
|
+
</div><table class="source_code">
|
740
|
+
<tr>
|
741
|
+
<td>
|
742
|
+
<pre class="lines">
|
743
|
+
|
744
|
+
|
745
|
+
6
|
746
|
+
7
|
747
|
+
8
|
748
|
+
9
|
749
|
+
10
|
750
|
+
11
|
751
|
+
12
|
752
|
+
13
|
753
|
+
14
|
754
|
+
15
|
755
|
+
16
|
756
|
+
17
|
757
|
+
18</pre>
|
758
|
+
</td>
|
759
|
+
<td>
|
760
|
+
<pre class="code"><span class="info file"># File 'lib/ovto/middleware.rb', line 6</span>
|
761
|
+
|
762
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='const'>Middleware</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
763
|
+
<span class='kw'>unless</span> <span class='const'><span class='object_link'><a href="#VALID_NAME_REXP-constant" title="Ovto::VALID_NAME_REXP (constant)">VALID_NAME_REXP</a></span></span> <span class='op'>=~</span> <span class='id identifier rubyid_name'>name</span>
|
764
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid middleware name: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
765
|
+
<span class='kw'>end</span>
|
766
|
+
<span class='kw'>return</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware.html" title="Ovto::Middleware (module)">Middleware</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware/Base.html" title="Ovto::Middleware::Base (class)">Base</a></span></span><span class='rparen'>)</span><span class='lbrace'>{</span>
|
767
|
+
<span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:OVTO_MIDDLEWARE_NAME</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
768
|
+
<span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:State</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/State.html" title="Ovto::State (class)">State</a></span></span><span class='rparen'>)</span>
|
769
|
+
<span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:Actions</span><span class='comma'>,</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware.html" title="Ovto::Middleware (module)">Middleware</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware/Actions.html" title="Ovto::Middleware::Actions (class)">Actions</a></span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
770
|
+
<span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='symbol'>:Actions</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:OVTO_MIDDLEWARE_NAME</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
771
|
+
<span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:Component</span><span class='comma'>,</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware.html" title="Ovto::Middleware (module)">Middleware</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Middleware/Component.html" title="Ovto::Middleware::Component (class)">Component</a></span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
772
|
+
<span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='symbol'>:Component</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='symbol'>:OVTO_MIDDLEWARE_NAME</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
773
|
+
<span class='rbrace'>}</span>
|
774
|
+
<span class='kw'>end</span></pre>
|
775
|
+
</td>
|
776
|
+
</tr>
|
777
|
+
</table>
|
778
|
+
</div>
|
779
|
+
|
780
|
+
<div class="method_details ">
|
781
|
+
<h3 class="signature " id="send_args_with_state-class_method">
|
782
|
+
|
783
|
+
.<strong>send_args_with_state</strong>(obj, meth, args, state, &block) ⇒ <tt>Object</tt>
|
784
|
+
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
</h3><div class="docstring">
|
790
|
+
<div class="discussion">
|
791
|
+
|
792
|
+
<p>Something like `obj.meth(state: state, **args, &block)` Safe even if `obj.meth` does not have `state:`</p>
|
793
|
+
|
794
|
+
|
795
|
+
</div>
|
796
|
+
</div>
|
797
|
+
<div class="tags">
|
798
|
+
|
799
|
+
|
800
|
+
</div><table class="source_code">
|
801
|
+
<tr>
|
802
|
+
<td>
|
803
|
+
<pre class="lines">
|
804
|
+
|
805
|
+
|
806
|
+
65
|
807
|
+
66
|
808
|
+
67
|
809
|
+
68
|
810
|
+
69
|
811
|
+
70
|
812
|
+
71
|
813
|
+
72
|
814
|
+
73
|
815
|
+
74
|
816
|
+
75
|
817
|
+
76
|
818
|
+
77
|
819
|
+
78
|
820
|
+
79
|
821
|
+
80
|
822
|
+
81
|
823
|
+
82
|
824
|
+
83
|
825
|
+
84</pre>
|
826
|
+
</td>
|
827
|
+
<td>
|
828
|
+
<pre class="code"><span class="info file"># File 'lib/ovto.rb', line 65</span>
|
829
|
+
|
830
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send_args_with_state'>send_args_with_state</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_state'>state</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
831
|
+
<span class='id identifier rubyid_parameters'>parameters</span> <span class='op'>=</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parameters'>parameters</span>
|
832
|
+
<span class='id identifier rubyid_accepts_state'>accepts_state</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>!parameters</span><span class='tstring_end'>`</span></span> <span class='op'>||</span> <span class='id identifier rubyid_parameters'>parameters</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_parameters'>parameters</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
|
833
|
+
<span class='id identifier rubyid_item'>item</span> <span class='op'>==</span> <span class='lbracket'>[</span><span class='symbol'>:key</span><span class='comma'>,</span> <span class='symbol'>:state</span><span class='rbracket'>]</span> <span class='op'>||</span>
|
834
|
+
<span class='id identifier rubyid_item'>item</span> <span class='op'>==</span> <span class='lbracket'>[</span><span class='symbol'>:keyreq</span><span class='comma'>,</span> <span class='symbol'>:state</span><span class='rbracket'>]</span> <span class='op'>||</span>
|
835
|
+
<span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:keyrest</span>
|
836
|
+
<span class='rbrace'>}</span>
|
837
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_accepts_state'>accepts_state</span>
|
838
|
+
<span class='comment'># We can pass `state:` safely
|
839
|
+
</span> <span class='id identifier rubyid_args_with_state'>args_with_state</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>state:</span> <span class='id identifier rubyid_state'>state</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
840
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_args_with_state'>args_with_state</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
841
|
+
<span class='kw'>else</span>
|
842
|
+
<span class='comment'># Check it is empty (see https://github.com/opal/opal/issues/1872)
|
843
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
844
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
845
|
+
<span class='kw'>else</span>
|
846
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</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_block'>block</span><span class='rparen'>)</span>
|
847
|
+
<span class='kw'>end</span>
|
848
|
+
<span class='kw'>end</span>
|
849
|
+
<span class='kw'>end</span></pre>
|
850
|
+
</td>
|
851
|
+
</tr>
|
852
|
+
</table>
|
660
853
|
</div>
|
661
854
|
|
662
855
|
</div>
|
@@ -664,9 +857,9 @@
|
|
664
857
|
</div>
|
665
858
|
|
666
859
|
<div id="footer">
|
667
|
-
Generated on
|
860
|
+
Generated on Fri Oct 22 08:18:17 2021 by
|
668
861
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
669
|
-
0.9.
|
862
|
+
0.9.26 (ruby-3.0.2).
|
670
863
|
</div>
|
671
864
|
|
672
865
|
</div>
|