kabk 0.2.0
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.
Potentially problematic release.
This version of kabk might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CHANGELOG.md +27 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +108 -0
- data/Kabk_logo.svg +33 -0
- data/LICENSE +21 -0
- data/README.md +101 -0
- data/doc/Kabk/Adapters/Base.html +854 -0
- data/doc/Kabk/Adapters/SequelAdapter.html +948 -0
- data/doc/Kabk/Adapters.html +120 -0
- data/doc/Kabk/ApiError.html +511 -0
- data/doc/Kabk/Auth/JwtStrategy.html +551 -0
- data/doc/Kabk/Auth.html +118 -0
- data/doc/Kabk/Concurrency.html +297 -0
- data/doc/Kabk/ConcurrencyConflictError.html +225 -0
- data/doc/Kabk/Error.html +140 -0
- data/doc/Kabk/ExportHandler.html +381 -0
- data/doc/Kabk/Field.html +2160 -0
- data/doc/Kabk/ForbiddenError.html +225 -0
- data/doc/Kabk/InvalidFieldError.html +136 -0
- data/doc/Kabk/InvalidOldPasswordError.html +225 -0
- data/doc/Kabk/NotFoundError.html +225 -0
- data/doc/Kabk/QueryBuilder.html +551 -0
- data/doc/Kabk/Registry.html +608 -0
- data/doc/Kabk/RelationHydrator.html +480 -0
- data/doc/Kabk/Resource.html +1986 -0
- data/doc/Kabk/ResourceBuilder.html +1002 -0
- data/doc/Kabk/RestEngine.html +879 -0
- data/doc/Kabk/SchemaRenderer.html +318 -0
- data/doc/Kabk/UnauthorizedError.html +225 -0
- data/doc/Kabk/UploadHandler.html +308 -0
- data/doc/Kabk/ValidationError.html +225 -0
- data/doc/Kabk/Validator.html +380 -0
- data/doc/Kabk.html +330 -0
- data/doc/_index.html +376 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +206 -0
- data/doc/css/style.css +1089 -0
- data/doc/file.README.html +149 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +149 -0
- data/doc/js/app.js +801 -0
- data/doc/js/full_list.js +334 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +910 -0
- data/doc/top-level-namespace.html +112 -0
- data/docs/API_REFERENCE.md +241 -0
- data/lib/kabk/adapters/base.rb +45 -0
- data/lib/kabk/adapters/sequel_adapter.rb +125 -0
- data/lib/kabk/concurrency.rb +30 -0
- data/lib/kabk/errors.rb +62 -0
- data/lib/kabk/export_handler.rb +43 -0
- data/lib/kabk/field.rb +97 -0
- data/lib/kabk/query_builder.rb +72 -0
- data/lib/kabk/registry.rb +41 -0
- data/lib/kabk/relation_hydrator.rb +107 -0
- data/lib/kabk/resource.rb +88 -0
- data/lib/kabk/resource_builder.rb +93 -0
- data/lib/kabk/rest_engine.rb +84 -0
- data/lib/kabk/schema_renderer.rb +69 -0
- data/lib/kabk/upload_handler.rb +24 -0
- data/lib/kabk/validator.rb +64 -0
- data/lib/kabk/version.rb +6 -0
- data/lib/kabk.rb +51 -0
- metadata +193 -0
|
@@ -0,0 +1,1002 @@
|
|
|
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: Kabk::ResourceBuilder
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.45
|
|
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 = "Kabk::ResourceBuilder";
|
|
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 id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
32
|
+
<div class="nav_wrap">
|
|
33
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
34
|
+
<div id="resizer"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="main" tabindex="-1">
|
|
38
|
+
<div id="header">
|
|
39
|
+
<div id="menu">
|
|
40
|
+
|
|
41
|
+
<a href="../_index.html">Index (R)</a> »
|
|
42
|
+
<span class='title'><span class='object_link'><a href="../Kabk.html" title="Kabk (module)">Kabk</a></span></span>
|
|
43
|
+
»
|
|
44
|
+
<span class="title">ResourceBuilder</span>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="search">
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="class_list_link"
|
|
51
|
+
href="../class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content"><h1>Class: Kabk::ResourceBuilder
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</h1>
|
|
69
|
+
<div class="box_info">
|
|
70
|
+
|
|
71
|
+
<dl>
|
|
72
|
+
<dt>Inherits:</dt>
|
|
73
|
+
<dd>
|
|
74
|
+
<span class="inheritName">Object</span>
|
|
75
|
+
|
|
76
|
+
<ul class="fullTree">
|
|
77
|
+
<li>Object</li>
|
|
78
|
+
|
|
79
|
+
<li class="next">Kabk::ResourceBuilder</li>
|
|
80
|
+
|
|
81
|
+
</ul>
|
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
83
|
+
|
|
84
|
+
</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dt>Defined in:</dt>
|
|
99
|
+
<dd>lib/kabk/resource_builder.rb
|
|
100
|
+
</dd>
|
|
101
|
+
</dl>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<h2>Overview</h2><div class="docstring">
|
|
106
|
+
<div class="discussion">
|
|
107
|
+
<p>DSL builder for resources</p>
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="tags">
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<h2>
|
|
123
|
+
Instance Method Summary
|
|
124
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
125
|
+
</h2>
|
|
126
|
+
|
|
127
|
+
<ul class="summary">
|
|
128
|
+
|
|
129
|
+
<li class="public ">
|
|
130
|
+
<span class="summary_signature">
|
|
131
|
+
|
|
132
|
+
<a href="#after_create-instance_method" title="#after_create (instance method)">#<strong>after_create</strong> {|record, context| ... } ⇒ Object </a>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
</span>
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed after the record is created.</p></div></span>
|
|
147
|
+
|
|
148
|
+
</li>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<li class="public ">
|
|
152
|
+
<span class="summary_signature">
|
|
153
|
+
|
|
154
|
+
<a href="#after_delete-instance_method" title="#after_delete (instance method)">#<strong>after_delete</strong> {|id, context| ... } ⇒ Object </a>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</span>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed after the record is deleted.</p></div></span>
|
|
169
|
+
|
|
170
|
+
</li>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<li class="public ">
|
|
174
|
+
<span class="summary_signature">
|
|
175
|
+
|
|
176
|
+
<a href="#after_update-instance_method" title="#after_update (instance method)">#<strong>after_update</strong> {|record, context| ... } ⇒ Object </a>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
</span>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed after the record is updated.</p></div></span>
|
|
191
|
+
|
|
192
|
+
</li>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
<li class="public ">
|
|
196
|
+
<span class="summary_signature">
|
|
197
|
+
|
|
198
|
+
<a href="#before_create-instance_method" title="#before_create (instance method)">#<strong>before_create</strong> {|params, context| ... } ⇒ Object </a>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
</span>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed before the record is created.</p></div></span>
|
|
213
|
+
|
|
214
|
+
</li>
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<li class="public ">
|
|
218
|
+
<span class="summary_signature">
|
|
219
|
+
|
|
220
|
+
<a href="#before_delete-instance_method" title="#before_delete (instance method)">#<strong>before_delete</strong> {|id, context| ... } ⇒ Object </a>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed before the record is deleted.</p></div></span>
|
|
235
|
+
|
|
236
|
+
</li>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<li class="public ">
|
|
240
|
+
<span class="summary_signature">
|
|
241
|
+
|
|
242
|
+
<a href="#before_update-instance_method" title="#before_update (instance method)">#<strong>before_update</strong> {|id, params, context| ... } ⇒ Object </a>
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
</span>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<span class="summary_desc"><div class='inline'><p>Registers a callback executed before the record is updated.</p></div></span>
|
|
257
|
+
|
|
258
|
+
</li>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<li class="public ">
|
|
262
|
+
<span class="summary_signature">
|
|
263
|
+
|
|
264
|
+
<a href="#field-instance_method" title="#field (instance method)">#<strong>field</strong>(name, type:, form_type:, **attributes) ⇒ Object </a>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
</span>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<span class="summary_desc"><div class='inline'><p>Define a field with attributes.</p></div></span>
|
|
279
|
+
|
|
280
|
+
</li>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
<li class="public ">
|
|
284
|
+
<span class="summary_signature">
|
|
285
|
+
|
|
286
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(resource) ⇒ ResourceBuilder </a>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
</span>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<span class="note title constructor">constructor</span>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of ResourceBuilder.</p></div></span>
|
|
303
|
+
|
|
304
|
+
</li>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
<li class="public ">
|
|
308
|
+
<span class="summary_signature">
|
|
309
|
+
|
|
310
|
+
<a href="#method_missing-instance_method" title="#method_missing (instance method)">#<strong>method_missing</strong>(method_name, *args, **kwargs) ⇒ Object </a>
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</span>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
<span class="summary_desc"><div class='inline'><p>Delegate dynamic attribute setting (e.g. title, icon, plural_name).</p></div></span>
|
|
325
|
+
|
|
326
|
+
</li>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
<li class="public ">
|
|
330
|
+
<span class="summary_signature">
|
|
331
|
+
|
|
332
|
+
<a href="#permissions-instance_method" title="#permissions (instance method)">#<strong>permissions</strong>(**perms) ⇒ Object </a>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
</span>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
<span class="summary_desc"><div class='inline'><p>Configure permissions explicitly.</p></div></span>
|
|
347
|
+
|
|
348
|
+
</li>
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
<li class="public ">
|
|
352
|
+
<span class="summary_signature">
|
|
353
|
+
|
|
354
|
+
<a href="#respond_to_missing%3F-instance_method" title="#respond_to_missing? (instance method)">#<strong>respond_to_missing?</strong>(method_name, include_private = false) ⇒ Boolean </a>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
</span>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
369
|
+
|
|
370
|
+
</li>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
</ul>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
<div id="constructor_details" class="method_details_list">
|
|
378
|
+
<h2>Constructor Details</h2>
|
|
379
|
+
|
|
380
|
+
<div class="method_details first">
|
|
381
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
382
|
+
|
|
383
|
+
#<strong>initialize</strong>(resource) ⇒ <tt><span class='object_link'><a href="" title="Kabk::ResourceBuilder (class)">ResourceBuilder</a></span></tt>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
</h3><div class="docstring">
|
|
390
|
+
<div class="discussion">
|
|
391
|
+
<p>Returns a new instance of ResourceBuilder.</p>
|
|
392
|
+
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
<div class="tags">
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</div><table class="source_code">
|
|
399
|
+
<tr>
|
|
400
|
+
<td>
|
|
401
|
+
<pre class="lines">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
10
|
|
405
|
+
11
|
|
406
|
+
12</pre>
|
|
407
|
+
</td>
|
|
408
|
+
<td>
|
|
409
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 10</span>
|
|
410
|
+
|
|
411
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='rparen'>)</span>
|
|
412
|
+
<span class='ivar'>@resource</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span>
|
|
413
|
+
<span class='kw'>end</span></pre>
|
|
414
|
+
</td>
|
|
415
|
+
</tr>
|
|
416
|
+
</table>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
</div>
|
|
420
|
+
<div id="method_missing_details" class="method_details_list">
|
|
421
|
+
<h2>Dynamic Method Handling</h2>
|
|
422
|
+
<p class="notice this">
|
|
423
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
|
424
|
+
|
|
425
|
+
</p>
|
|
426
|
+
|
|
427
|
+
<div class="method_details first">
|
|
428
|
+
<h3 class="signature first" id="method_missing-instance_method">
|
|
429
|
+
|
|
430
|
+
#<strong>method_missing</strong>(method_name, *args, **kwargs) ⇒ <tt>Object</tt>
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
</h3><div class="docstring">
|
|
437
|
+
<div class="discussion">
|
|
438
|
+
<p>Delegate dynamic attribute setting (e.g. title, icon, plural_name)</p>
|
|
439
|
+
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
<div class="tags">
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
</div><table class="source_code">
|
|
446
|
+
<tr>
|
|
447
|
+
<td>
|
|
448
|
+
<pre class="lines">
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
15
|
|
452
|
+
16
|
|
453
|
+
17
|
|
454
|
+
18
|
|
455
|
+
19
|
|
456
|
+
20
|
|
457
|
+
21
|
|
458
|
+
22
|
|
459
|
+
23
|
|
460
|
+
24
|
|
461
|
+
25
|
|
462
|
+
26</pre>
|
|
463
|
+
</td>
|
|
464
|
+
<td>
|
|
465
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 15</span>
|
|
466
|
+
|
|
467
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method_name'>method_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='comma'>,</span> <span class='op'>&</span><span class='rparen'>)</span>
|
|
468
|
+
<span class='kw'>if</span> <span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_method_name'>method_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
469
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='op'>&&</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
470
|
+
<span class='id identifier rubyid_kwargs'>kwargs</span>
|
|
471
|
+
<span class='kw'>else</span>
|
|
472
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
|
473
|
+
<span class='kw'>end</span>
|
|
474
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_method_name'>method_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
475
|
+
<span class='kw'>else</span>
|
|
476
|
+
<span class='kw'>super</span>
|
|
477
|
+
<span class='kw'>end</span>
|
|
478
|
+
<span class='kw'>end</span></pre>
|
|
479
|
+
</td>
|
|
480
|
+
</tr>
|
|
481
|
+
</table>
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
</div>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
<div id="instance_method_details" class="method_details_list">
|
|
488
|
+
<h2>Instance Method Details</h2>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
<div class="method_details first">
|
|
492
|
+
<h3 class="signature first" id="after_create-instance_method">
|
|
493
|
+
|
|
494
|
+
#<strong>after_create</strong> {|record, context| ... } ⇒ <tt>Object</tt>
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
</h3><div class="docstring">
|
|
501
|
+
<div class="discussion">
|
|
502
|
+
<p>Registers a callback executed after the record is created.</p>
|
|
503
|
+
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
<div class="tags">
|
|
507
|
+
|
|
508
|
+
<p class="tag_title">Yields:</p>
|
|
509
|
+
<ul class="yield">
|
|
510
|
+
|
|
511
|
+
<li>
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
<span class='type'>(<tt>record</tt>, <tt>context</tt>)</span>
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
—
|
|
519
|
+
<div class='inline'><p>The newly created record hash and host context.</p></div>
|
|
520
|
+
|
|
521
|
+
</li>
|
|
522
|
+
|
|
523
|
+
</ul>
|
|
524
|
+
|
|
525
|
+
</div><table class="source_code">
|
|
526
|
+
<tr>
|
|
527
|
+
<td>
|
|
528
|
+
<pre class="lines">
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
65
|
|
532
|
+
66
|
|
533
|
+
67</pre>
|
|
534
|
+
</td>
|
|
535
|
+
<td>
|
|
536
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 65</span>
|
|
537
|
+
|
|
538
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_after_create'>after_create</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
539
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:after_create</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
540
|
+
<span class='kw'>end</span></pre>
|
|
541
|
+
</td>
|
|
542
|
+
</tr>
|
|
543
|
+
</table>
|
|
544
|
+
</div>
|
|
545
|
+
|
|
546
|
+
<div class="method_details ">
|
|
547
|
+
<h3 class="signature " id="after_delete-instance_method">
|
|
548
|
+
|
|
549
|
+
#<strong>after_delete</strong> {|id, context| ... } ⇒ <tt>Object</tt>
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
</h3><div class="docstring">
|
|
556
|
+
<div class="discussion">
|
|
557
|
+
<p>Registers a callback executed after the record is deleted.</p>
|
|
558
|
+
|
|
559
|
+
</div>
|
|
560
|
+
</div>
|
|
561
|
+
<div class="tags">
|
|
562
|
+
|
|
563
|
+
<p class="tag_title">Yields:</p>
|
|
564
|
+
<ul class="yield">
|
|
565
|
+
|
|
566
|
+
<li>
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
<span class='type'>(<tt>id</tt>, <tt>context</tt>)</span>
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
—
|
|
574
|
+
<div class='inline'><p>The deleted record ID and host context.</p></div>
|
|
575
|
+
|
|
576
|
+
</li>
|
|
577
|
+
|
|
578
|
+
</ul>
|
|
579
|
+
|
|
580
|
+
</div><table class="source_code">
|
|
581
|
+
<tr>
|
|
582
|
+
<td>
|
|
583
|
+
<pre class="lines">
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
89
|
|
587
|
+
90
|
|
588
|
+
91</pre>
|
|
589
|
+
</td>
|
|
590
|
+
<td>
|
|
591
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 89</span>
|
|
592
|
+
|
|
593
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_after_delete'>after_delete</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
594
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:after_delete</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
595
|
+
<span class='kw'>end</span></pre>
|
|
596
|
+
</td>
|
|
597
|
+
</tr>
|
|
598
|
+
</table>
|
|
599
|
+
</div>
|
|
600
|
+
|
|
601
|
+
<div class="method_details ">
|
|
602
|
+
<h3 class="signature " id="after_update-instance_method">
|
|
603
|
+
|
|
604
|
+
#<strong>after_update</strong> {|record, context| ... } ⇒ <tt>Object</tt>
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
</h3><div class="docstring">
|
|
611
|
+
<div class="discussion">
|
|
612
|
+
<p>Registers a callback executed after the record is updated.</p>
|
|
613
|
+
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div class="tags">
|
|
617
|
+
|
|
618
|
+
<p class="tag_title">Yields:</p>
|
|
619
|
+
<ul class="yield">
|
|
620
|
+
|
|
621
|
+
<li>
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
<span class='type'>(<tt>record</tt>, <tt>context</tt>)</span>
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
—
|
|
629
|
+
<div class='inline'><p>The updated record hash and host context.</p></div>
|
|
630
|
+
|
|
631
|
+
</li>
|
|
632
|
+
|
|
633
|
+
</ul>
|
|
634
|
+
|
|
635
|
+
</div><table class="source_code">
|
|
636
|
+
<tr>
|
|
637
|
+
<td>
|
|
638
|
+
<pre class="lines">
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
77
|
|
642
|
+
78
|
|
643
|
+
79</pre>
|
|
644
|
+
</td>
|
|
645
|
+
<td>
|
|
646
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 77</span>
|
|
647
|
+
|
|
648
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_after_update'>after_update</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
649
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:after_update</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
650
|
+
<span class='kw'>end</span></pre>
|
|
651
|
+
</td>
|
|
652
|
+
</tr>
|
|
653
|
+
</table>
|
|
654
|
+
</div>
|
|
655
|
+
|
|
656
|
+
<div class="method_details ">
|
|
657
|
+
<h3 class="signature " id="before_create-instance_method">
|
|
658
|
+
|
|
659
|
+
#<strong>before_create</strong> {|params, context| ... } ⇒ <tt>Object</tt>
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
</h3><div class="docstring">
|
|
666
|
+
<div class="discussion">
|
|
667
|
+
<p>Registers a callback executed before the record is created.</p>
|
|
668
|
+
|
|
669
|
+
</div>
|
|
670
|
+
</div>
|
|
671
|
+
<div class="tags">
|
|
672
|
+
|
|
673
|
+
<p class="tag_title">Yields:</p>
|
|
674
|
+
<ul class="yield">
|
|
675
|
+
|
|
676
|
+
<li>
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
<span class='type'>(<tt>params</tt>, <tt>context</tt>)</span>
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
—
|
|
684
|
+
<div class='inline'><p>The incoming parameters and host context.</p></div>
|
|
685
|
+
|
|
686
|
+
</li>
|
|
687
|
+
|
|
688
|
+
</ul>
|
|
689
|
+
|
|
690
|
+
</div><table class="source_code">
|
|
691
|
+
<tr>
|
|
692
|
+
<td>
|
|
693
|
+
<pre class="lines">
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
59
|
|
697
|
+
60
|
|
698
|
+
61</pre>
|
|
699
|
+
</td>
|
|
700
|
+
<td>
|
|
701
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 59</span>
|
|
702
|
+
|
|
703
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_before_create'>before_create</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
704
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:before_create</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
705
|
+
<span class='kw'>end</span></pre>
|
|
706
|
+
</td>
|
|
707
|
+
</tr>
|
|
708
|
+
</table>
|
|
709
|
+
</div>
|
|
710
|
+
|
|
711
|
+
<div class="method_details ">
|
|
712
|
+
<h3 class="signature " id="before_delete-instance_method">
|
|
713
|
+
|
|
714
|
+
#<strong>before_delete</strong> {|id, context| ... } ⇒ <tt>Object</tt>
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
</h3><div class="docstring">
|
|
721
|
+
<div class="discussion">
|
|
722
|
+
<p>Registers a callback executed before the record is deleted.</p>
|
|
723
|
+
|
|
724
|
+
</div>
|
|
725
|
+
</div>
|
|
726
|
+
<div class="tags">
|
|
727
|
+
|
|
728
|
+
<p class="tag_title">Yields:</p>
|
|
729
|
+
<ul class="yield">
|
|
730
|
+
|
|
731
|
+
<li>
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
<span class='type'>(<tt>id</tt>, <tt>context</tt>)</span>
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
—
|
|
739
|
+
<div class='inline'><p>The record ID and host context.</p></div>
|
|
740
|
+
|
|
741
|
+
</li>
|
|
742
|
+
|
|
743
|
+
</ul>
|
|
744
|
+
|
|
745
|
+
</div><table class="source_code">
|
|
746
|
+
<tr>
|
|
747
|
+
<td>
|
|
748
|
+
<pre class="lines">
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
83
|
|
752
|
+
84
|
|
753
|
+
85</pre>
|
|
754
|
+
</td>
|
|
755
|
+
<td>
|
|
756
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 83</span>
|
|
757
|
+
|
|
758
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_before_delete'>before_delete</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
759
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:before_delete</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
760
|
+
<span class='kw'>end</span></pre>
|
|
761
|
+
</td>
|
|
762
|
+
</tr>
|
|
763
|
+
</table>
|
|
764
|
+
</div>
|
|
765
|
+
|
|
766
|
+
<div class="method_details ">
|
|
767
|
+
<h3 class="signature " id="before_update-instance_method">
|
|
768
|
+
|
|
769
|
+
#<strong>before_update</strong> {|id, params, context| ... } ⇒ <tt>Object</tt>
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
</h3><div class="docstring">
|
|
776
|
+
<div class="discussion">
|
|
777
|
+
<p>Registers a callback executed before the record is updated.</p>
|
|
778
|
+
|
|
779
|
+
</div>
|
|
780
|
+
</div>
|
|
781
|
+
<div class="tags">
|
|
782
|
+
|
|
783
|
+
<p class="tag_title">Yields:</p>
|
|
784
|
+
<ul class="yield">
|
|
785
|
+
|
|
786
|
+
<li>
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
<span class='type'>(<tt>id</tt>, <tt>params</tt>, <tt>context</tt>)</span>
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
—
|
|
794
|
+
<div class='inline'><p>The record ID, incoming parameters, and host context.</p></div>
|
|
795
|
+
|
|
796
|
+
</li>
|
|
797
|
+
|
|
798
|
+
</ul>
|
|
799
|
+
|
|
800
|
+
</div><table class="source_code">
|
|
801
|
+
<tr>
|
|
802
|
+
<td>
|
|
803
|
+
<pre class="lines">
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
71
|
|
807
|
+
72
|
|
808
|
+
73</pre>
|
|
809
|
+
</td>
|
|
810
|
+
<td>
|
|
811
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 71</span>
|
|
812
|
+
|
|
813
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_before_update'>before_update</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
814
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_hooks'>hooks</span><span class='lbracket'>[</span><span class='symbol'>:before_update</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
815
|
+
<span class='kw'>end</span></pre>
|
|
816
|
+
</td>
|
|
817
|
+
</tr>
|
|
818
|
+
</table>
|
|
819
|
+
</div>
|
|
820
|
+
|
|
821
|
+
<div class="method_details ">
|
|
822
|
+
<h3 class="signature " id="field-instance_method">
|
|
823
|
+
|
|
824
|
+
#<strong>field</strong>(name, type:, form_type:, **attributes) ⇒ <tt>Object</tt>
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
</h3><div class="docstring">
|
|
831
|
+
<div class="discussion">
|
|
832
|
+
<p>Define a field with attributes</p>
|
|
833
|
+
|
|
834
|
+
</div>
|
|
835
|
+
</div>
|
|
836
|
+
<div class="tags">
|
|
837
|
+
|
|
838
|
+
<p class="tag_title">Raises:</p>
|
|
839
|
+
<ul class="raise">
|
|
840
|
+
|
|
841
|
+
<li>
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
<span class='type'>(<tt><span class='object_link'><a href="InvalidFieldError.html" title="Kabk::InvalidFieldError (class)">InvalidFieldError</a></span></tt>)</span>
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
</li>
|
|
849
|
+
|
|
850
|
+
</ul>
|
|
851
|
+
|
|
852
|
+
</div><table class="source_code">
|
|
853
|
+
<tr>
|
|
854
|
+
<td>
|
|
855
|
+
<pre class="lines">
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
33
|
|
859
|
+
34
|
|
860
|
+
35
|
|
861
|
+
36
|
|
862
|
+
37
|
|
863
|
+
38
|
|
864
|
+
39
|
|
865
|
+
40
|
|
866
|
+
41
|
|
867
|
+
42
|
|
868
|
+
43
|
|
869
|
+
44
|
|
870
|
+
45
|
|
871
|
+
46
|
|
872
|
+
47
|
|
873
|
+
48</pre>
|
|
874
|
+
</td>
|
|
875
|
+
<td>
|
|
876
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 33</span>
|
|
877
|
+
|
|
878
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>type:</span><span class='comma'>,</span> <span class='label'>form_type:</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
|
|
879
|
+
<span class='comment'># Validate required keys per spec
|
|
880
|
+
</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="InvalidFieldError.html" title="Kabk::InvalidFieldError (class)">InvalidFieldError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Field '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>' is missing 'type'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span>
|
|
881
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="InvalidFieldError.html" title="Kabk::InvalidFieldError (class)">InvalidFieldError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Field '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>' is missing 'form_type'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_form_type'>form_type</span>
|
|
882
|
+
|
|
883
|
+
<span class='comment'># Extract label, if not provided, default to titleized name
|
|
884
|
+
</span> <span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='rparen'>)</span>
|
|
885
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
886
|
+
<span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:fa</span><span class='comma'>,</span> <span class='symbol'>:en</span><span class='rparen'>)</span>
|
|
887
|
+
<span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='period'>.</span><span class='id identifier rubyid_tr'>tr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
888
|
+
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid__v'>_v</span><span class='op'>|</span> <span class='qsymbols_beg'>%i[</span><span class='tstring_content'>fa</span><span class='words_sep'> </span><span class='tstring_content'>en</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
889
|
+
<span class='kw'>end</span>
|
|
890
|
+
|
|
891
|
+
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Field.html" title="Kabk::Field (class)">Field</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Field.html#initialize-instance_method" title="Kabk::Field#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='label'>form_type:</span> <span class='id identifier rubyid_form_type'>form_type</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
|
|
892
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span> <span class='op'><<</span> <span class='id identifier rubyid_f'>f</span>
|
|
893
|
+
<span class='kw'>end</span></pre>
|
|
894
|
+
</td>
|
|
895
|
+
</tr>
|
|
896
|
+
</table>
|
|
897
|
+
</div>
|
|
898
|
+
|
|
899
|
+
<div class="method_details ">
|
|
900
|
+
<h3 class="signature " id="permissions-instance_method">
|
|
901
|
+
|
|
902
|
+
#<strong>permissions</strong>(**perms) ⇒ <tt>Object</tt>
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
</h3><div class="docstring">
|
|
909
|
+
<div class="discussion">
|
|
910
|
+
<p>Configure permissions explicitly</p>
|
|
911
|
+
|
|
912
|
+
</div>
|
|
913
|
+
</div>
|
|
914
|
+
<div class="tags">
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
</div><table class="source_code">
|
|
918
|
+
<tr>
|
|
919
|
+
<td>
|
|
920
|
+
<pre class="lines">
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
51
|
|
924
|
+
52
|
|
925
|
+
53</pre>
|
|
926
|
+
</td>
|
|
927
|
+
<td>
|
|
928
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 51</span>
|
|
929
|
+
|
|
930
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_permissions'>permissions</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_perms'>perms</span><span class='rparen'>)</span>
|
|
931
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_permissions'>permissions</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_perms'>perms</span><span class='rparen'>)</span>
|
|
932
|
+
<span class='kw'>end</span></pre>
|
|
933
|
+
</td>
|
|
934
|
+
</tr>
|
|
935
|
+
</table>
|
|
936
|
+
</div>
|
|
937
|
+
|
|
938
|
+
<div class="method_details ">
|
|
939
|
+
<h3 class="signature " id="respond_to_missing?-instance_method">
|
|
940
|
+
|
|
941
|
+
#<strong>respond_to_missing?</strong>(method_name, include_private = false) ⇒ <tt>Boolean</tt>
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
</h3><div class="docstring">
|
|
948
|
+
<div class="discussion">
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
</div>
|
|
952
|
+
</div>
|
|
953
|
+
<div class="tags">
|
|
954
|
+
|
|
955
|
+
<p class="tag_title">Returns:</p>
|
|
956
|
+
<ul class="return">
|
|
957
|
+
|
|
958
|
+
<li>
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
</li>
|
|
966
|
+
|
|
967
|
+
</ul>
|
|
968
|
+
|
|
969
|
+
</div><table class="source_code">
|
|
970
|
+
<tr>
|
|
971
|
+
<td>
|
|
972
|
+
<pre class="lines">
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
28
|
|
976
|
+
29
|
|
977
|
+
30</pre>
|
|
978
|
+
</td>
|
|
979
|
+
<td>
|
|
980
|
+
<pre class="code"><span class="info file"># File 'lib/kabk/resource_builder.rb', line 28</span>
|
|
981
|
+
|
|
982
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_respond_to_missing?'>respond_to_missing?</span><span class='lparen'>(</span><span class='id identifier rubyid_method_name'>method_name</span><span class='comma'>,</span> <span class='id identifier rubyid_include_private'>include_private</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
983
|
+
<span class='ivar'>@resource</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_method_name'>method_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>super</span>
|
|
984
|
+
<span class='kw'>end</span></pre>
|
|
985
|
+
</td>
|
|
986
|
+
</tr>
|
|
987
|
+
</table>
|
|
988
|
+
</div>
|
|
989
|
+
|
|
990
|
+
</div>
|
|
991
|
+
|
|
992
|
+
</div>
|
|
993
|
+
|
|
994
|
+
<div id="footer">
|
|
995
|
+
Generated on Tue Aug 11 21:17:07 2026 by
|
|
996
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
997
|
+
0.9.45 (ruby-4.0.6).
|
|
998
|
+
</div>
|
|
999
|
+
|
|
1000
|
+
</div>
|
|
1001
|
+
</body>
|
|
1002
|
+
</html>
|