compony 0.11.8 → 0.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +36 -1
- data/CHANGELOG.md +31 -0
- data/CLAUDE.md +85 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -3
- data/VERSION +1 -1
- data/compony.gemspec +3 -3
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +54 -54
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +109 -70
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +64 -28
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +213 -74
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Buttons/CssButton.html +1 -1
- data/doc/Compony/Components/Buttons/Link.html +1 -1
- data/doc/Compony/Components/Buttons.html +1 -1
- data/doc/Compony/Components/Destroy.html +83 -29
- data/doc/Compony/Components/Edit.html +110 -38
- data/doc/Compony/Components/Form.html +551 -208
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +3 -3
- data/doc/Compony/Components/New.html +110 -38
- data/doc/Compony/Components/Show.html +1 -1
- data/doc/Compony/Components/WithForm.html +194 -47
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/Intent.html +2 -2
- data/doc/Compony/ManageIntentsDsl.html +1 -1
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +1 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +1 -1
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony/VirtualModel.html +1 -1
- data/doc/Compony.html +1 -1
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +97 -1
- data/doc/file.CHANGELOG.html +758 -0
- data/doc/file.README.html +25 -4
- data/doc/file.basic_component.html +314 -0
- data/doc/file.cookbook.html +189 -0
- data/doc/file.destroy.html +105 -0
- data/doc/file.dsl_reference.html +672 -0
- data/doc/file.edit.html +109 -0
- data/doc/file.example.html +291 -0
- data/doc/file.example_advanced.html +257 -0
- data/doc/file.feasibility.html +115 -0
- data/doc/file.form.html +195 -0
- data/doc/file.generators.html +89 -0
- data/doc/file.glossary.html +217 -0
- data/doc/file.gotchas.html +222 -0
- data/doc/file.index.html +135 -0
- data/doc/file.inheritance.html +136 -0
- data/doc/file.installation.html +115 -0
- data/doc/file.integrations.html +218 -0
- data/doc/file.intents.html +265 -0
- data/doc/file.internal_datastructures.html +129 -0
- data/doc/file.list.html +253 -0
- data/doc/file.maintaining.html +127 -0
- data/doc/file.model_fields.html +137 -0
- data/doc/file.nesting.html +237 -0
- data/doc/file.new.html +109 -0
- data/doc/file.ownership.html +98 -0
- data/doc/file.patterns.html +669 -0
- data/doc/file.pre_built_components.html +99 -0
- data/doc/file.resourceful.html +181 -0
- data/doc/file.show.html +158 -0
- data/doc/file.standalone.html +233 -0
- data/doc/file.virtual_models.html +117 -0
- data/doc/file.with_form.html +157 -0
- data/doc/file_list.html +160 -0
- data/doc/guide/cookbook.md +41 -0
- data/doc/guide/dsl_reference.md +155 -0
- data/doc/guide/example_advanced.md +209 -0
- data/doc/guide/generators.md +1 -1
- data/doc/guide/glossary.md +42 -0
- data/doc/guide/gotchas.md +125 -0
- data/doc/guide/maintaining.md +64 -0
- data/doc/guide/patterns.md +681 -0
- data/doc/guide/pre_built_components/edit.md +1 -1
- data/doc/guide/pre_built_components/index.md +64 -1
- data/doc/guide/pre_built_components/list.md +111 -7
- data/doc/guide/pre_built_components/show.md +57 -2
- data/doc/guide/pre_built_components/with_form.md +56 -9
- data/doc/guide/pre_built_components.md +7 -2
- data/doc/guide/standalone.md +16 -1
- data/doc/index.html +25 -4
- data/doc/integrations.md +61 -0
- data/doc/llms.txt +62 -0
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component.rb +8 -3
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +32 -15
- data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +11 -3
- data/lib/compony/component_mixins/resourceful.rb +30 -16
- data/lib/compony/components/destroy.rb +21 -1
- data/lib/compony/components/edit.rb +25 -1
- data/lib/compony/components/form.rb +63 -21
- data/lib/compony/components/list.rb +1 -1
- data/lib/compony/components/new.rb +25 -1
- data/lib/compony/components/with_form.rb +20 -5
- data/lib/compony/intent.rb +1 -1
- metadata +43 -1
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
|
|
283
283
|
|
|
284
284
|
<h2>
|
|
285
|
-
|
|
285
|
+
DSL
|
|
286
286
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
287
287
|
</h2>
|
|
288
288
|
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
<li class="protected ">
|
|
292
292
|
<span class="summary_signature">
|
|
293
293
|
|
|
294
|
-
<a href="#after_assign_attributes-instance_method" title="#after_assign_attributes (instance method)">#<strong>after_assign_attributes</strong>
|
|
294
|
+
<a href="#after_assign_attributes-instance_method" title="#after_assign_attributes (instance method)">#<strong>after_assign_attributes</strong> { ... } ⇒ void </a>
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
<li class="protected ">
|
|
316
316
|
<span class="summary_signature">
|
|
317
317
|
|
|
318
|
-
<a href="#after_load_data-instance_method" title="#after_load_data (instance method)">#<strong>after_load_data</strong>
|
|
318
|
+
<a href="#after_load_data-instance_method" title="#after_load_data (instance method)">#<strong>after_load_data</strong> { ... } ⇒ void </a>
|
|
319
319
|
|
|
320
320
|
|
|
321
321
|
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
|
|
331
331
|
|
|
332
332
|
<span class="summary_desc"><div class='inline'>
|
|
333
|
-
<p>DSL method Runs after
|
|
333
|
+
<p>DSL method Runs after <code>load_data</code> and before authorization for all standalone paths and verbs.</p>
|
|
334
334
|
</div></span>
|
|
335
335
|
|
|
336
336
|
</li>
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
<li class="protected ">
|
|
340
340
|
<span class="summary_signature">
|
|
341
341
|
|
|
342
|
-
<a href="#assign_attributes-instance_method" title="#assign_attributes (instance method)">#<strong>assign_attributes</strong>
|
|
342
|
+
<a href="#assign_attributes-instance_method" title="#assign_attributes (instance method)">#<strong>assign_attributes</strong> { ... } ⇒ void </a>
|
|
343
343
|
|
|
344
344
|
|
|
345
345
|
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
|
|
355
355
|
|
|
356
356
|
<span class="summary_desc"><div class='inline'>
|
|
357
|
-
<p>DSL method Sets
|
|
357
|
+
<p>DSL method Sets the default <code>assign_attributes</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl).</p>
|
|
358
358
|
</div></span>
|
|
359
359
|
|
|
360
360
|
</li>
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
<li class="public ">
|
|
364
364
|
<span class="summary_signature">
|
|
365
365
|
|
|
366
|
-
<a href="#data_class-instance_method" title="#data_class (instance method)">#<strong>data_class</strong>(new_data_class = nil) ⇒
|
|
366
|
+
<a href="#data_class-instance_method" title="#data_class (instance method)">#<strong>data_class</strong>(new_data_class = nil) ⇒ Class </a>
|
|
367
367
|
|
|
368
368
|
|
|
369
369
|
|
|
@@ -378,16 +378,16 @@
|
|
|
378
378
|
|
|
379
379
|
|
|
380
380
|
<span class="summary_desc"><div class='inline'>
|
|
381
|
-
<p>DSL method Sets or calculates the model class
|
|
381
|
+
<p>DSL method Sets or calculates the model class.</p>
|
|
382
382
|
</div></span>
|
|
383
383
|
|
|
384
384
|
</li>
|
|
385
385
|
|
|
386
386
|
|
|
387
|
-
<li class="
|
|
387
|
+
<li class="protected ">
|
|
388
388
|
<span class="summary_signature">
|
|
389
389
|
|
|
390
|
-
<a href="#
|
|
390
|
+
<a href="#load_data-instance_method" title="#load_data (instance method)">#<strong>load_data</strong> { ... } ⇒ void </a>
|
|
391
391
|
|
|
392
392
|
|
|
393
393
|
|
|
@@ -395,21 +395,23 @@
|
|
|
395
395
|
|
|
396
396
|
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
<span class="note title protected">protected</span>
|
|
399
399
|
|
|
400
400
|
|
|
401
401
|
|
|
402
402
|
|
|
403
403
|
|
|
404
|
-
<span class="summary_desc"><div class='inline'
|
|
404
|
+
<span class="summary_desc"><div class='inline'>
|
|
405
|
+
<p>DSL method Sets the default <code>load_data</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl).</p>
|
|
406
|
+
</div></span>
|
|
405
407
|
|
|
406
408
|
</li>
|
|
407
409
|
|
|
408
410
|
|
|
409
|
-
<li class="
|
|
411
|
+
<li class="public ">
|
|
410
412
|
<span class="summary_signature">
|
|
411
413
|
|
|
412
|
-
<a href="#
|
|
414
|
+
<a href="#resourceful%3F-instance_method" title="#resourceful? (instance method)">#<strong>resourceful?</strong> ⇒ Boolean </a>
|
|
413
415
|
|
|
414
416
|
|
|
415
417
|
|
|
@@ -417,23 +419,21 @@
|
|
|
417
419
|
|
|
418
420
|
|
|
419
421
|
|
|
420
|
-
|
|
422
|
+
|
|
421
423
|
|
|
422
424
|
|
|
423
425
|
|
|
424
426
|
|
|
425
427
|
|
|
426
|
-
<span class="summary_desc"><div class='inline'>
|
|
427
|
-
<p>DSL method Sets a default load_data block for all standalone paths and verbs.</p>
|
|
428
|
-
</div></span>
|
|
428
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
429
429
|
|
|
430
430
|
</li>
|
|
431
431
|
|
|
432
432
|
|
|
433
|
-
<li class="
|
|
433
|
+
<li class="protected ">
|
|
434
434
|
<span class="summary_signature">
|
|
435
435
|
|
|
436
|
-
<a href="#
|
|
436
|
+
<a href="#store_data-instance_method" title="#store_data (instance method)">#<strong>store_data</strong> { ... } ⇒ void </a>
|
|
437
437
|
|
|
438
438
|
|
|
439
439
|
|
|
@@ -441,21 +441,32 @@
|
|
|
441
441
|
|
|
442
442
|
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
<span class="note title protected">protected</span>
|
|
445
445
|
|
|
446
446
|
|
|
447
447
|
|
|
448
448
|
|
|
449
449
|
|
|
450
|
-
<span class="summary_desc"><div class='inline'
|
|
450
|
+
<span class="summary_desc"><div class='inline'>
|
|
451
|
+
<p>DSL method Sets the default <code>store_data</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl).</p>
|
|
452
|
+
</div></span>
|
|
451
453
|
|
|
452
454
|
</li>
|
|
453
455
|
|
|
454
456
|
|
|
455
|
-
|
|
457
|
+
</ul>
|
|
458
|
+
|
|
459
|
+
<h2>
|
|
460
|
+
Instance Method Summary
|
|
461
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
462
|
+
</h2>
|
|
463
|
+
|
|
464
|
+
<ul class="summary">
|
|
465
|
+
|
|
466
|
+
<li class="public ">
|
|
456
467
|
<span class="summary_signature">
|
|
457
468
|
|
|
458
|
-
<a href="#
|
|
469
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(data: nil, data_class: nil, **nargs) ⇒ Object </a>
|
|
459
470
|
|
|
460
471
|
|
|
461
472
|
|
|
@@ -463,15 +474,13 @@
|
|
|
463
474
|
|
|
464
475
|
|
|
465
476
|
|
|
466
|
-
|
|
477
|
+
|
|
467
478
|
|
|
468
479
|
|
|
469
480
|
|
|
470
481
|
|
|
471
482
|
|
|
472
|
-
<span class="summary_desc"><div class='inline'>
|
|
473
|
-
<p>DSL method Sets a default store_data block for all standalone paths and verbs.</p>
|
|
474
|
-
</div></span>
|
|
483
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
475
484
|
|
|
476
485
|
</li>
|
|
477
486
|
|
|
@@ -742,7 +751,7 @@
|
|
|
742
751
|
<div class="method_details first">
|
|
743
752
|
<h3 class="signature first" id="after_assign_attributes-instance_method">
|
|
744
753
|
|
|
745
|
-
#<strong>after_assign_attributes</strong>
|
|
754
|
+
#<strong>after_assign_attributes</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
746
755
|
|
|
747
756
|
|
|
748
757
|
|
|
@@ -750,14 +759,32 @@
|
|
|
750
759
|
|
|
751
760
|
</h3><div class="docstring">
|
|
752
761
|
<div class="discussion">
|
|
753
|
-
|
|
754
|
-
<p>DSL method Runs after <code>assign_attributes</code> and before <code>store_data</code> for all standalone paths and verbs. Example
|
|
762
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
763
|
+
<p>DSL method Runs after <code>assign_attributes</code> and before <code>store_data</code> for all standalone paths and verbs. Example: prefill or derive fields before validation.</p>
|
|
755
764
|
|
|
756
765
|
|
|
757
766
|
</div>
|
|
758
767
|
</div>
|
|
759
768
|
<div class="tags">
|
|
760
769
|
|
|
770
|
+
<p class="tag_title">Yields:</p>
|
|
771
|
+
<ul class="yield">
|
|
772
|
+
|
|
773
|
+
<li>
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
<span class='type'></span>
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
<div class='inline'>
|
|
782
|
+
<p>Runs in the component’s request context; may mutate <code>@data</code>.</p>
|
|
783
|
+
</div>
|
|
784
|
+
|
|
785
|
+
</li>
|
|
786
|
+
|
|
787
|
+
</ul>
|
|
761
788
|
|
|
762
789
|
</div><table class="source_code">
|
|
763
790
|
<tr>
|
|
@@ -765,12 +792,12 @@
|
|
|
765
792
|
<pre class="lines">
|
|
766
793
|
|
|
767
794
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
795
|
+
83
|
|
796
|
+
84
|
|
797
|
+
85</pre>
|
|
771
798
|
</td>
|
|
772
799
|
<td>
|
|
773
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
800
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 83</span>
|
|
774
801
|
|
|
775
802
|
<span class='kw'>def</span> <span class='id identifier rubyid_after_assign_attributes'>after_assign_attributes</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
776
803
|
<span class='ivar'>@global_after_assign_attributes_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -783,7 +810,7 @@
|
|
|
783
810
|
<div class="method_details ">
|
|
784
811
|
<h3 class="signature " id="after_load_data-instance_method">
|
|
785
812
|
|
|
786
|
-
#<strong>after_load_data</strong>
|
|
813
|
+
#<strong>after_load_data</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
787
814
|
|
|
788
815
|
|
|
789
816
|
|
|
@@ -791,14 +818,32 @@
|
|
|
791
818
|
|
|
792
819
|
</h3><div class="docstring">
|
|
793
820
|
<div class="discussion">
|
|
794
|
-
|
|
795
|
-
<p>DSL method Runs after
|
|
821
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
822
|
+
<p>DSL method Runs after <code>load_data</code> and before authorization for all standalone paths and verbs. Example: refine an AR collection produced by <code>load_data</code> before it is read.</p>
|
|
796
823
|
|
|
797
824
|
|
|
798
825
|
</div>
|
|
799
826
|
</div>
|
|
800
827
|
<div class="tags">
|
|
801
828
|
|
|
829
|
+
<p class="tag_title">Yields:</p>
|
|
830
|
+
<ul class="yield">
|
|
831
|
+
|
|
832
|
+
<li>
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
<span class='type'></span>
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
<div class='inline'>
|
|
841
|
+
<p>Runs in the component’s request context; may refine <code>@data</code>.</p>
|
|
842
|
+
</div>
|
|
843
|
+
|
|
844
|
+
</li>
|
|
845
|
+
|
|
846
|
+
</ul>
|
|
802
847
|
|
|
803
848
|
</div><table class="source_code">
|
|
804
849
|
<tr>
|
|
@@ -806,12 +851,12 @@
|
|
|
806
851
|
<pre class="lines">
|
|
807
852
|
|
|
808
853
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
854
|
+
62
|
|
855
|
+
63
|
|
856
|
+
64</pre>
|
|
812
857
|
</td>
|
|
813
858
|
<td>
|
|
814
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
859
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 62</span>
|
|
815
860
|
|
|
816
861
|
<span class='kw'>def</span> <span class='id identifier rubyid_after_load_data'>after_load_data</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
817
862
|
<span class='ivar'>@global_after_load_data_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -824,7 +869,7 @@
|
|
|
824
869
|
<div class="method_details ">
|
|
825
870
|
<h3 class="signature " id="assign_attributes-instance_method">
|
|
826
871
|
|
|
827
|
-
#<strong>assign_attributes</strong>
|
|
872
|
+
#<strong>assign_attributes</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
828
873
|
|
|
829
874
|
|
|
830
875
|
|
|
@@ -832,14 +877,32 @@
|
|
|
832
877
|
|
|
833
878
|
</h3><div class="docstring">
|
|
834
879
|
<div class="discussion">
|
|
835
|
-
|
|
836
|
-
<p>DSL method Sets
|
|
880
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
881
|
+
<p>DSL method Sets the default <code>assign_attributes</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl). The block is expected to assign validated <code>params</code> to attributes of <code>@data</code>.</p>
|
|
837
882
|
|
|
838
883
|
|
|
839
884
|
</div>
|
|
840
885
|
</div>
|
|
841
886
|
<div class="tags">
|
|
842
887
|
|
|
888
|
+
<p class="tag_title">Yields:</p>
|
|
889
|
+
<ul class="yield">
|
|
890
|
+
|
|
891
|
+
<li>
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
<span class='type'></span>
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
<div class='inline'>
|
|
900
|
+
<p>Runs in the component’s request context; assigns params onto <code>@data</code>.</p>
|
|
901
|
+
</div>
|
|
902
|
+
|
|
903
|
+
</li>
|
|
904
|
+
|
|
905
|
+
</ul>
|
|
843
906
|
|
|
844
907
|
<p class="tag_title">See Also:</p>
|
|
845
908
|
<ul class="see">
|
|
@@ -854,12 +917,12 @@
|
|
|
854
917
|
<pre class="lines">
|
|
855
918
|
|
|
856
919
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
920
|
+
73
|
|
921
|
+
74
|
|
922
|
+
75</pre>
|
|
860
923
|
</td>
|
|
861
924
|
<td>
|
|
862
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
925
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 73</span>
|
|
863
926
|
|
|
864
927
|
<span class='kw'>def</span> <span class='id identifier rubyid_assign_attributes'>assign_attributes</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
865
928
|
<span class='ivar'>@global_assign_attributes_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -872,7 +935,7 @@
|
|
|
872
935
|
<div class="method_details ">
|
|
873
936
|
<h3 class="signature " id="data_class-instance_method">
|
|
874
937
|
|
|
875
|
-
#<strong>data_class</strong>(new_data_class = nil) ⇒ <tt>
|
|
938
|
+
#<strong>data_class</strong>(new_data_class = nil) ⇒ <tt>Class</tt>
|
|
876
939
|
|
|
877
940
|
|
|
878
941
|
|
|
@@ -881,13 +944,53 @@
|
|
|
881
944
|
</h3><div class="docstring">
|
|
882
945
|
<div class="discussion">
|
|
883
946
|
|
|
884
|
-
<p>DSL method Sets or calculates the model class
|
|
947
|
+
<p>DSL method Sets or calculates the model class. Defaults to the component’s family name, singularized and constantized.</p>
|
|
885
948
|
|
|
886
949
|
|
|
887
950
|
</div>
|
|
888
951
|
</div>
|
|
889
952
|
<div class="tags">
|
|
953
|
+
<p class="tag_title">Parameters:</p>
|
|
954
|
+
<ul class="param">
|
|
955
|
+
|
|
956
|
+
<li>
|
|
957
|
+
|
|
958
|
+
<span class='name'>new_data_class</span>
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
<span class='type'>(<tt>Class</tt>, <tt>nil</tt>)</span>
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
—
|
|
968
|
+
<div class='inline'>
|
|
969
|
+
<p>If given, the model class to use (e.g. a <span class='object_link'><a href="../VirtualModel.html" title="Compony::VirtualModel (class)">VirtualModel</a></span> subclass).</p>
|
|
970
|
+
</div>
|
|
971
|
+
|
|
972
|
+
</li>
|
|
973
|
+
|
|
974
|
+
</ul>
|
|
975
|
+
|
|
976
|
+
<p class="tag_title">Returns:</p>
|
|
977
|
+
<ul class="return">
|
|
978
|
+
|
|
979
|
+
<li>
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
<span class='type'>(<tt>Class</tt>)</span>
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
—
|
|
987
|
+
<div class='inline'>
|
|
988
|
+
<p>The resolved data class.</p>
|
|
989
|
+
</div>
|
|
990
|
+
|
|
991
|
+
</li>
|
|
890
992
|
|
|
993
|
+
</ul>
|
|
891
994
|
|
|
892
995
|
</div><table class="source_code">
|
|
893
996
|
<tr>
|
|
@@ -895,12 +998,12 @@
|
|
|
895
998
|
<pre class="lines">
|
|
896
999
|
|
|
897
1000
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1001
|
+
35
|
|
1002
|
+
36
|
|
1003
|
+
37</pre>
|
|
901
1004
|
</td>
|
|
902
1005
|
<td>
|
|
903
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
1006
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 35</span>
|
|
904
1007
|
|
|
905
1008
|
<span class='kw'>def</span> <span class='id identifier rubyid_data_class'>data_class</span><span class='lparen'>(</span><span class='id identifier rubyid_new_data_class'>new_data_class</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
906
1009
|
<span class='ivar'>@data_class</span> <span class='op'>||=</span> <span class='id identifier rubyid_new_data_class'>new_data_class</span> <span class='op'>||</span> <span class='id identifier rubyid_family_name'>family_name</span><span class='period'>.</span><span class='id identifier rubyid_singularize'>singularize</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span>
|
|
@@ -964,7 +1067,7 @@
|
|
|
964
1067
|
<div class="method_details ">
|
|
965
1068
|
<h3 class="signature " id="load_data-instance_method">
|
|
966
1069
|
|
|
967
|
-
#<strong>load_data</strong>
|
|
1070
|
+
#<strong>load_data</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
968
1071
|
|
|
969
1072
|
|
|
970
1073
|
|
|
@@ -972,14 +1075,32 @@
|
|
|
972
1075
|
|
|
973
1076
|
</h3><div class="docstring">
|
|
974
1077
|
<div class="discussion">
|
|
975
|
-
|
|
976
|
-
<p>DSL method Sets
|
|
1078
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
1079
|
+
<p>DSL method Sets the default <code>load_data</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl). Runs before authorization. The block is expected to assign <code>@data</code>.</p>
|
|
977
1080
|
|
|
978
1081
|
|
|
979
1082
|
</div>
|
|
980
1083
|
</div>
|
|
981
1084
|
<div class="tags">
|
|
982
1085
|
|
|
1086
|
+
<p class="tag_title">Yields:</p>
|
|
1087
|
+
<ul class="yield">
|
|
1088
|
+
|
|
1089
|
+
<li>
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
<span class='type'></span>
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
<div class='inline'>
|
|
1098
|
+
<p>Runs in the component’s request context; must assign <code>@data</code>.</p>
|
|
1099
|
+
</div>
|
|
1100
|
+
|
|
1101
|
+
</li>
|
|
1102
|
+
|
|
1103
|
+
</ul>
|
|
983
1104
|
|
|
984
1105
|
<p class="tag_title">See Also:</p>
|
|
985
1106
|
<ul class="see">
|
|
@@ -994,12 +1115,12 @@
|
|
|
994
1115
|
<pre class="lines">
|
|
995
1116
|
|
|
996
1117
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1118
|
+
52
|
|
1119
|
+
53
|
|
1120
|
+
54</pre>
|
|
1000
1121
|
</td>
|
|
1001
1122
|
<td>
|
|
1002
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
1123
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 52</span>
|
|
1003
1124
|
|
|
1004
1125
|
<span class='kw'>def</span> <span class='id identifier rubyid_load_data'>load_data</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1005
1126
|
<span class='ivar'>@global_load_data_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -1046,12 +1167,12 @@
|
|
|
1046
1167
|
<pre class="lines">
|
|
1047
1168
|
|
|
1048
1169
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1170
|
+
39
|
|
1171
|
+
40
|
|
1172
|
+
41</pre>
|
|
1052
1173
|
</td>
|
|
1053
1174
|
<td>
|
|
1054
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
1175
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 39</span>
|
|
1055
1176
|
|
|
1056
1177
|
<span class='kw'>def</span> <span class='id identifier rubyid_resourceful?'>resourceful?</span>
|
|
1057
1178
|
<span class='kw'>return</span> <span class='kw'>true</span>
|
|
@@ -1064,7 +1185,7 @@
|
|
|
1064
1185
|
<div class="method_details ">
|
|
1065
1186
|
<h3 class="signature " id="store_data-instance_method">
|
|
1066
1187
|
|
|
1067
|
-
#<strong>store_data</strong>
|
|
1188
|
+
#<strong>store_data</strong> { ... } ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
1068
1189
|
|
|
1069
1190
|
|
|
1070
1191
|
|
|
@@ -1072,14 +1193,32 @@
|
|
|
1072
1193
|
|
|
1073
1194
|
</h3><div class="docstring">
|
|
1074
1195
|
<div class="discussion">
|
|
1075
|
-
|
|
1076
|
-
<p>DSL method Sets
|
|
1196
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
|
1197
|
+
<p>DSL method Sets the default <code>store_data</code> block for all standalone paths and verbs (overridable per verb in the VerbDsl). The block is expected to persist <code>@data</code> (override e.g. for virtual models or custom persistence).</p>
|
|
1077
1198
|
|
|
1078
1199
|
|
|
1079
1200
|
</div>
|
|
1080
1201
|
</div>
|
|
1081
1202
|
<div class="tags">
|
|
1082
1203
|
|
|
1204
|
+
<p class="tag_title">Yields:</p>
|
|
1205
|
+
<ul class="yield">
|
|
1206
|
+
|
|
1207
|
+
<li>
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
<span class='type'></span>
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
<div class='inline'>
|
|
1216
|
+
<p>Runs in the component’s request context; persists <code>@data</code>.</p>
|
|
1217
|
+
</div>
|
|
1218
|
+
|
|
1219
|
+
</li>
|
|
1220
|
+
|
|
1221
|
+
</ul>
|
|
1083
1222
|
|
|
1084
1223
|
<p class="tag_title">See Also:</p>
|
|
1085
1224
|
<ul class="see">
|
|
@@ -1094,12 +1233,12 @@
|
|
|
1094
1233
|
<pre class="lines">
|
|
1095
1234
|
|
|
1096
1235
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1236
|
+
94
|
|
1237
|
+
95
|
|
1238
|
+
96</pre>
|
|
1100
1239
|
</td>
|
|
1101
1240
|
<td>
|
|
1102
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line
|
|
1241
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/resourceful.rb', line 94</span>
|
|
1103
1242
|
|
|
1104
1243
|
<span class='kw'>def</span> <span class='id identifier rubyid_store_data'>store_data</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1105
1244
|
<span class='ivar'>@global_store_data_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
@@ -1114,7 +1253,7 @@
|
|
|
1114
1253
|
</div>
|
|
1115
1254
|
|
|
1116
1255
|
<div id="footer">
|
|
1117
|
-
Generated on
|
|
1256
|
+
Generated on Mon May 18 13:55:35 2026 by
|
|
1118
1257
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1119
1258
|
0.9.34 (ruby-3.3.5).
|
|
1120
1259
|
</div>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Mon May 18 13:55:35 2026 by
|
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.9.34 (ruby-3.3.5).
|
|
122
122
|
</div>
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
</div>
|
|
273
273
|
|
|
274
274
|
<div id="footer">
|
|
275
|
-
Generated on
|
|
275
|
+
Generated on Mon May 18 13:55:36 2026 by
|
|
276
276
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
277
277
|
0.9.34 (ruby-3.3.5).
|
|
278
278
|
</div>
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
</div>
|
|
243
243
|
|
|
244
244
|
<div id="footer">
|
|
245
|
-
Generated on
|
|
245
|
+
Generated on Mon May 18 13:55:36 2026 by
|
|
246
246
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
247
247
|
0.9.34 (ruby-3.3.5).
|
|
248
248
|
</div>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Mon May 18 13:55:35 2026 by
|
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.9.34 (ruby-3.3.5).
|
|
122
122
|
</div>
|