compony 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile.lock +3 -3
  4. data/README.md +1397 -33
  5. data/Rakefile +6 -2
  6. data/TODO.md +1 -0
  7. data/VERSION +1 -0
  8. data/app/controllers/compony_controller.rb +3 -1
  9. data/compony.gemspec +7 -7
  10. data/config/locales/fr.yml +33 -0
  11. data/doc/ComponentGenerator.html +231 -0
  12. data/doc/Components.html +105 -0
  13. data/doc/ComponentsGenerator.html +203 -0
  14. data/doc/Compony/Component.html +2098 -0
  15. data/doc/Compony/ComponentMixins/Default/Labelling.html +406 -0
  16. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +539 -0
  17. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +588 -0
  18. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +577 -0
  19. data/doc/Compony/ComponentMixins/Default/Standalone.html +692 -0
  20. data/doc/Compony/ComponentMixins/Default.html +126 -0
  21. data/doc/Compony/ComponentMixins/Resourceful.html +1193 -0
  22. data/doc/Compony/ComponentMixins.html +126 -0
  23. data/doc/Compony/Components/Button.html +293 -0
  24. data/doc/Compony/Components/Destroy.html +384 -0
  25. data/doc/Compony/Components/Edit.html +462 -0
  26. data/doc/Compony/Components/Form.html +1112 -0
  27. data/doc/Compony/Components/New.html +462 -0
  28. data/doc/Compony/Components/WithForm.html +528 -0
  29. data/doc/Compony/Components.html +126 -0
  30. data/doc/Compony/ControllerMixin.html +136 -0
  31. data/doc/Compony/Engine.html +133 -0
  32. data/doc/Compony/MethodAccessibleHash.html +453 -0
  33. data/doc/Compony/ModelFields/Anchormodel.html +383 -0
  34. data/doc/Compony/ModelFields/Association.html +613 -0
  35. data/doc/Compony/ModelFields/Attachment.html +305 -0
  36. data/doc/Compony/ModelFields/Base.html +1066 -0
  37. data/doc/Compony/ModelFields/Boolean.html +232 -0
  38. data/doc/Compony/ModelFields/Color.html +299 -0
  39. data/doc/Compony/ModelFields/Currency.html +232 -0
  40. data/doc/Compony/ModelFields/Date.html +232 -0
  41. data/doc/Compony/ModelFields/Datetime.html +232 -0
  42. data/doc/Compony/ModelFields/Decimal.html +154 -0
  43. data/doc/Compony/ModelFields/Email.html +240 -0
  44. data/doc/Compony/ModelFields/Float.html +154 -0
  45. data/doc/Compony/ModelFields/Integer.html +154 -0
  46. data/doc/Compony/ModelFields/Percentage.html +232 -0
  47. data/doc/Compony/ModelFields/Phone.html +301 -0
  48. data/doc/Compony/ModelFields/RichText.html +232 -0
  49. data/doc/Compony/ModelFields/String.html +154 -0
  50. data/doc/Compony/ModelFields/Text.html +154 -0
  51. data/doc/Compony/ModelFields/Time.html +154 -0
  52. data/doc/Compony/ModelFields/Url.html +240 -0
  53. data/doc/Compony/ModelFields.html +126 -0
  54. data/doc/Compony/ModelMixin.html +524 -0
  55. data/doc/Compony/RequestContext.html +791 -0
  56. data/doc/Compony/Version.html +139 -0
  57. data/doc/Compony/ViewHelpers.html +443 -0
  58. data/doc/Compony.html +2156 -0
  59. data/doc/ComponyController.html +124 -0
  60. data/doc/_index.html +569 -0
  61. data/doc/class_list.html +51 -0
  62. data/doc/css/common.css +1 -0
  63. data/doc/css/full_list.css +58 -0
  64. data/doc/css/style.css +497 -0
  65. data/doc/file.README.html +1565 -0
  66. data/doc/file_list.html +56 -0
  67. data/doc/frames.html +17 -0
  68. data/doc/imgs/intro-example-destroy.png +0 -0
  69. data/doc/imgs/intro-example-edit.png +0 -0
  70. data/doc/imgs/intro-example-index.png +0 -0
  71. data/doc/imgs/intro-example-new.png +0 -0
  72. data/doc/imgs/intro-example-show.png +0 -0
  73. data/doc/index.html +1565 -0
  74. data/doc/js/app.js +314 -0
  75. data/doc/js/full_list.js +216 -0
  76. data/doc/js/jquery.js +4 -0
  77. data/doc/method_list.html +1435 -0
  78. data/doc/resourceful_lifecycle.png +0 -0
  79. data/doc/top-level-namespace.html +112 -0
  80. data/lib/compony/component.rb +2 -1
  81. data/lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb +1 -1
  82. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +14 -3
  83. data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +14 -5
  84. data/lib/compony/component_mixins/default/standalone.rb +10 -3
  85. data/lib/compony/components/form.rb +6 -1
  86. data/lib/compony/components/with_form.rb +14 -1
  87. data/lib/compony/model_fields/anchormodel.rb +0 -22
  88. data/lib/compony/model_mixin.rb +12 -2
  89. data/lib/compony/version.rb +1 -7
  90. data/logo.svg +133 -0
  91. metadata +83 -6
@@ -0,0 +1,588 @@
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: Compony::ComponentMixins::Default::Standalone::StandaloneDsl
8
+
9
+ &mdash; Documentation by YARD 0.9.34
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 = "Compony::ComponentMixins::Default::Standalone::StandaloneDsl";
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 (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../../Compony.html" title="Compony (module)">Compony</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../../ComponentMixins.html" title="Compony::ComponentMixins (module)">ComponentMixins</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Default.html" title="Compony::ComponentMixins::Default (module)">Default</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Standalone.html" title="Compony::ComponentMixins::Default::Standalone (module)">Standalone</a></span></span>
41
+ &raquo;
42
+ <span class="title">StandaloneDsl</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: Compony::ComponentMixins::Default::Standalone::StandaloneDsl
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Dslblend::Base</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Dslblend::Base</li>
78
+
79
+ <li class="next">Compony::ComponentMixins::Default::Standalone::StandaloneDsl</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/compony/component_mixins/default/standalone/standalone_dsl.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Wrapper and DSL helper for component’s standalone config Pass <code>provide_defaults</code> true if this is the first standalone DSL of a component. Pass false if it is a subsequent one (e.g. if subclassed comp)</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>
124
+ Instance Method Summary
125
+ <small><a href="#" class="summary_toggle">collapse</a></small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(component, name = nil, provide_defaults:, path: nil) &#x21d2; StandaloneDsl </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+ <span class="note title constructor">constructor</span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ <span class="summary_desc"><div class='inline'>
150
+ <p>A new instance of StandaloneDsl.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ <li class="protected ">
157
+ <span class="summary_signature">
158
+
159
+ <a href="#layout-instance_method" title="#layout (instance method)">#<strong>layout</strong>(layout) &#x21d2; Object </a>
160
+
161
+
162
+
163
+ </span>
164
+
165
+
166
+
167
+ <span class="note title protected">protected</span>
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>DSL Speficies the Rails layout (under <code>app/views/layouts</code>) that should be used to render this component.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ <li class="protected ">
181
+ <span class="summary_signature">
182
+
183
+ <a href="#skip_authentication!-instance_method" title="#skip_authentication! (instance method)">#<strong>skip_authentication!</strong> &#x21d2; Object </a>
184
+
185
+
186
+
187
+ </span>
188
+
189
+
190
+
191
+ <span class="note title protected">protected</span>
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'>
198
+ <p>DSL Defines that for this component, no authentication should be performed.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#to_conf-instance_method" title="#to_conf (instance method)">#<strong>to_conf</strong>(&amp;block) &#x21d2; Object </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'>
222
+ <p>For internal usage only, processes the block and returns a config hash.</p>
223
+ </div></span>
224
+
225
+ </li>
226
+
227
+
228
+ <li class="protected ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#verb-instance_method" title="#verb (instance method)">#<strong>verb</strong>(verb, *args, **nargs) &#x21d2; Object </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+
239
+ <span class="note title protected">protected</span>
240
+
241
+
242
+
243
+
244
+
245
+ <span class="summary_desc"><div class='inline'>
246
+ <p>DSL call for defining a config for a verb.</p>
247
+ </div></span>
248
+
249
+ </li>
250
+
251
+
252
+ </ul>
253
+
254
+
255
+
256
+ <div id="constructor_details" class="method_details_list">
257
+ <h2>Constructor Details</h2>
258
+
259
+ <div class="method_details first">
260
+ <h3 class="signature first" id="initialize-instance_method">
261
+
262
+ #<strong>initialize</strong>(component, name = nil, provide_defaults:, path: nil) &#x21d2; <tt><span class='object_link'><a href="" title="Compony::ComponentMixins::Default::Standalone::StandaloneDsl (class)">StandaloneDsl</a></span></tt>
263
+
264
+
265
+
266
+
267
+
268
+ </h3><div class="docstring">
269
+ <div class="discussion">
270
+
271
+ <p>Returns a new instance of StandaloneDsl.</p>
272
+
273
+
274
+ </div>
275
+ </div>
276
+ <div class="tags">
277
+
278
+
279
+ </div><table class="source_code">
280
+ <tr>
281
+ <td>
282
+ <pre class="lines">
283
+
284
+
285
+ 9
286
+ 10
287
+ 11
288
+ 12
289
+ 13
290
+ 14
291
+ 15
292
+ 16
293
+ 17
294
+ 18</pre>
295
+ </td>
296
+ <td>
297
+ <pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 9</span>
298
+
299
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>provide_defaults:</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
300
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
301
+ <span class='ivar'>@component</span> <span class='op'>=</span> <span class='id identifier rubyid_component'>component</span>
302
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='op'>&amp;.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
303
+ <span class='ivar'>@provide_defaults</span> <span class='op'>=</span> <span class='id identifier rubyid_provide_defaults'>provide_defaults</span>
304
+ <span class='ivar'>@path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
305
+ <span class='ivar'>@verbs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
306
+ <span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>false</span>
307
+ <span class='ivar'>@layout</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='comment'># can be overriden by false or a string
308
+ </span><span class='kw'>end</span></pre>
309
+ </td>
310
+ </tr>
311
+ </table>
312
+ </div>
313
+
314
+ </div>
315
+
316
+
317
+ <div id="instance_method_details" class="method_details_list">
318
+ <h2>Instance Method Details</h2>
319
+
320
+
321
+ <div class="method_details first">
322
+ <h3 class="signature first" id="layout-instance_method">
323
+
324
+ #<strong>layout</strong>(layout) &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
325
+
326
+
327
+
328
+
329
+
330
+ </h3><div class="docstring">
331
+ <div class="discussion">
332
+
333
+ <p>DSL Speficies the Rails layout (under <code>app/views/layouts</code>) that should be used to render this component. Defaults to Rails’ default (<code>layouts/application</code>) if the method is never called.</p>
334
+
335
+
336
+ </div>
337
+ </div>
338
+ <div class="tags">
339
+ <p class="tag_title">Parameters:</p>
340
+ <ul class="param">
341
+
342
+ <li>
343
+
344
+ <span class='name'>layout</span>
345
+
346
+
347
+ <span class='type'>(<tt>String</tt>)</span>
348
+
349
+
350
+
351
+ &mdash;
352
+ <div class='inline'>
353
+ <p>name of the layout as you would give it to a Rails controller’s <code>render</code> method</p>
354
+ </div>
355
+
356
+ </li>
357
+
358
+ </ul>
359
+
360
+
361
+ </div><table class="source_code">
362
+ <tr>
363
+ <td>
364
+ <pre class="lines">
365
+
366
+
367
+ 66
368
+ 67
369
+ 68</pre>
370
+ </td>
371
+ <td>
372
+ <pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 66</span>
373
+
374
+ <span class='kw'>def</span> <span class='id identifier rubyid_layout'>layout</span><span class='lparen'>(</span><span class='id identifier rubyid_layout'>layout</span><span class='rparen'>)</span>
375
+ <span class='ivar'>@layout</span> <span class='op'>=</span> <span class='id identifier rubyid_layout'>layout</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
376
+ <span class='kw'>end</span></pre>
377
+ </td>
378
+ </tr>
379
+ </table>
380
+ </div>
381
+
382
+ <div class="method_details ">
383
+ <h3 class="signature " id="skip_authentication!-instance_method">
384
+
385
+ #<strong>skip_authentication!</strong> &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
386
+
387
+
388
+
389
+
390
+
391
+ </h3><div class="docstring">
392
+ <div class="discussion">
393
+
394
+ <p>DSL Defines that for this component, no authentication should be performed.</p>
395
+
396
+
397
+ </div>
398
+ </div>
399
+ <div class="tags">
400
+
401
+
402
+ </div><table class="source_code">
403
+ <tr>
404
+ <td>
405
+ <pre class="lines">
406
+
407
+
408
+ 58
409
+ 59
410
+ 60</pre>
411
+ </td>
412
+ <td>
413
+ <pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 58</span>
414
+
415
+ <span class='kw'>def</span> <span class='id identifier rubyid_skip_authentication!'>skip_authentication!</span>
416
+ <span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>true</span>
417
+ <span class='kw'>end</span></pre>
418
+ </td>
419
+ </tr>
420
+ </table>
421
+ </div>
422
+
423
+ <div class="method_details ">
424
+ <h3 class="signature " id="to_conf-instance_method">
425
+
426
+ #<strong>to_conf</strong>(&amp;block) &#x21d2; <tt>Object</tt>
427
+
428
+
429
+
430
+
431
+
432
+ </h3><div class="docstring">
433
+ <div class="discussion">
434
+
435
+ <p>For internal usage only, processes the block and returns a config hash.</p>
436
+
437
+
438
+ </div>
439
+ </div>
440
+ <div class="tags">
441
+
442
+
443
+ </div><table class="source_code">
444
+ <tr>
445
+ <td>
446
+ <pre class="lines">
447
+
448
+
449
+ 21
450
+ 22
451
+ 23
452
+ 24
453
+ 25
454
+ 26
455
+ 27
456
+ 28
457
+ 29
458
+ 30
459
+ 31
460
+ 32
461
+ 33</pre>
462
+ </td>
463
+ <td>
464
+ <pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 21</span>
465
+
466
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_conf'>to_conf</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
467
+ <span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
468
+ <span class='ivar'>@component</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>self</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># Fetches the component holding this DSL call (via the block)
469
+ </span> <span class='kw'>return</span> <span class='lbrace'>{</span>
470
+ <span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
471
+ <span class='label'>path:</span> <span class='ivar'>@path</span><span class='comma'>,</span>
472
+ <span class='label'>verbs:</span> <span class='ivar'>@verbs</span><span class='comma'>,</span>
473
+ <span class='label'>rails_action_name:</span> <span class='const'><span class='object_link'><a href="../../../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_rails_action_name'><span class='object_link'><a href="../../../../Compony.html#rails_action_name-class_method" title="Compony.rails_action_name (method)">rails_action_name</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='comma'>,</span> <span class='id identifier rubyid_family_name'>family_name</span><span class='comma'>,</span> <span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span>
474
+ <span class='label'>path_helper_name:</span> <span class='const'><span class='object_link'><a href="../../../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_path_helper_name'><span class='object_link'><a href="../../../../Compony.html#path_helper_name-class_method" title="Compony.path_helper_name (method)">path_helper_name</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='comma'>,</span> <span class='id identifier rubyid_family_name'>family_name</span><span class='comma'>,</span> <span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span>
475
+ <span class='label'>skip_authentication:</span> <span class='ivar'>@skip_authentication</span><span class='comma'>,</span>
476
+ <span class='label'>layout:</span> <span class='ivar'>@layout</span>
477
+ <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
478
+ <span class='kw'>end</span></pre>
479
+ </td>
480
+ </tr>
481
+ </table>
482
+ </div>
483
+
484
+ <div class="method_details ">
485
+ <h3 class="signature " id="verb-instance_method">
486
+
487
+ #<strong>verb</strong>(verb, *args, **nargs) &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
488
+
489
+
490
+
491
+
492
+
493
+ </h3><div class="docstring">
494
+ <div class="discussion">
495
+
496
+ <p>DSL call for defining a config for a verb. The block runs within the verb DSL, positional and named arguments are passed to the verb DSL.</p>
497
+
498
+
499
+ </div>
500
+ </div>
501
+ <div class="tags">
502
+ <p class="tag_title">Parameters:</p>
503
+ <ul class="param">
504
+
505
+ <li>
506
+
507
+ <span class='name'>verb</span>
508
+
509
+
510
+ <span class='type'>(<tt>Symbol</tt>)</span>
511
+
512
+
513
+
514
+ &mdash;
515
+ <div class='inline'>
516
+ <p>The HTTP verb the config is for (e.g. :get, :post etc.)</p>
517
+ </div>
518
+
519
+ </li>
520
+
521
+ </ul>
522
+
523
+
524
+ <p class="tag_title">See Also:</p>
525
+ <ul class="see">
526
+
527
+ <li><span class='object_link'><a href="VerbDsl.html" title="Compony::ComponentMixins::Default::Standalone::VerbDsl (class)">VerbDsl</a></span></li>
528
+
529
+ </ul>
530
+
531
+ </div><table class="source_code">
532
+ <tr>
533
+ <td>
534
+ <pre class="lines">
535
+
536
+
537
+ 40
538
+ 41
539
+ 42
540
+ 43
541
+ 44
542
+ 45
543
+ 46
544
+ 47
545
+ 48
546
+ 49
547
+ 50
548
+ 51
549
+ 52
550
+ 53
551
+ 54</pre>
552
+ </td>
553
+ <td>
554
+ <pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 40</span>
555
+
556
+ <span class='kw'>def</span> <span class='id identifier rubyid_verb'>verb</span><span class='lparen'>(</span><span class='id identifier rubyid_verb'>verb</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_nargs'>nargs</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
557
+ <span class='id identifier rubyid_verb'>verb</span> <span class='op'>=</span> <span class='id identifier rubyid_verb'>verb</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
558
+ <span class='id identifier rubyid_verb_dsl_class'>verb_dsl_class</span> <span class='op'>=</span> <span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_resourceful?'>resourceful?</span> <span class='op'>?</span> <span class='const'><span class='object_link'><a href="ResourcefulVerbDsl.html" title="Compony::ComponentMixins::Default::Standalone::ResourcefulVerbDsl (class)">ResourcefulVerbDsl</a></span></span> <span class='op'>:</span> <span class='const'><span class='object_link'><a href="VerbDsl.html" title="Compony::ComponentMixins::Default::Standalone::VerbDsl (class)">VerbDsl</a></span></span>
559
+ <span class='kw'>if</span> <span class='ivar'>@verbs</span><span class='lbracket'>[</span><span class='id identifier rubyid_verb'>verb</span><span class='rbracket'>]</span>
560
+ <span class='ivar'>@verbs</span><span class='lbracket'>[</span><span class='id identifier rubyid_verb'>verb</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge!'>deep_merge!</span> <span class='id identifier rubyid_verb_dsl_class'>verb_dsl_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='id identifier rubyid_verb'>verb</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_nargs'>nargs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_conf'>to_conf</span><span class='lparen'>(</span><span class='label'>provide_defaults:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
561
+ <span class='kw'>else</span>
562
+ <span class='comment'># Note about provide_defaults:
563
+ </span> <span class='comment'># - We must pass false if this is the second time `standalone` was called for this component -&gt; see @provide_defaults
564
+ </span> <span class='comment'># - We musst pass false if this is the second time `verb` was called for this component -&gt; handled by the if statement (other branch)
565
+ </span> <span class='comment'># - We must pass true otherwise (handled by this branch)
566
+ </span> <span class='ivar'>@verbs</span><span class='lbracket'>[</span><span class='id identifier rubyid_verb'>verb</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../MethodAccessibleHash.html" title="Compony::MethodAccessibleHash (class)">MethodAccessibleHash</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../../../MethodAccessibleHash.html#initialize-instance_method" title="Compony::MethodAccessibleHash#initialize (method)">new</a></span></span><span class='lparen'>(</span>
567
+ <span class='id identifier rubyid_verb_dsl_class'>verb_dsl_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='id identifier rubyid_verb'>verb</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_nargs'>nargs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_conf'>to_conf</span><span class='lparen'>(</span><span class='label'>provide_defaults:</span> <span class='ivar'>@provide_defaults</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
568
+ <span class='rparen'>)</span>
569
+ <span class='kw'>end</span>
570
+ <span class='kw'>end</span></pre>
571
+ </td>
572
+ </tr>
573
+ </table>
574
+ </div>
575
+
576
+ </div>
577
+
578
+ </div>
579
+
580
+ <div id="footer">
581
+ Generated on Wed Apr 24 17:14:06 2024 by
582
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
583
+ 0.9.34 (ruby-3.2.2).
584
+ </div>
585
+
586
+ </div>
587
+ </body>
588
+ </html>