compony 0.7.1 → 0.8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/Gemfile.lock +1 -1
- data/README.md +10 -14
- data/VERSION +1 -1
- data/compony.gemspec +4 -4
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +193 -457
- 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 +3 -3
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +187 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +2 -2
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Button.html +2 -2
- data/doc/Compony/Components/Buttons/CssButton.html +282 -0
- data/doc/Compony/Components/Buttons/Link.html +252 -0
- data/doc/Compony/Components/Buttons.html +126 -0
- data/doc/Compony/Components/Destroy.html +11 -11
- data/doc/Compony/Components/Edit.html +14 -14
- data/doc/Compony/Components/Form.html +100 -100
- data/doc/Compony/Components/Index.html +2 -2
- data/doc/Compony/Components/List.html +3 -3
- data/doc/Compony/Components/New.html +2 -2
- data/doc/Compony/Components/Show.html +24 -24
- data/doc/Compony/Components/WithForm.html +3 -3
- data/doc/Compony/Components.html +5 -3
- data/doc/Compony/ControllerMixin.html +2 -2
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/ExposedIntentsDsl.html +403 -0
- data/doc/Compony/Intent.html +1503 -0
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +2 -2
- 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 +177 -14
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +15 -272
- data/doc/Compony/VirtualModel.html +1 -1
- data/doc/Compony.html +303 -837
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +30 -2
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +11 -18
- data/doc/guide/basic_component.md +12 -8
- data/doc/guide/example.md +17 -17
- data/doc/guide/feasibility.md +4 -2
- data/doc/guide/generators.md +4 -2
- data/doc/guide/inheritance.md +4 -2
- data/doc/guide/installation.md +4 -2
- data/doc/guide/intents.md +167 -0
- data/doc/guide/internal_datastructures.md +4 -2
- data/doc/guide/model_fields.md +4 -2
- data/doc/guide/nesting.md +5 -3
- data/doc/guide/ownership.md +5 -3
- data/doc/guide/pre_built_components/destroy.md +3 -3
- data/doc/guide/pre_built_components/edit.md +1 -1
- data/doc/guide/pre_built_components/form.md +1 -1
- data/doc/guide/pre_built_components/index.md +1 -1
- data/doc/guide/pre_built_components/list.md +1 -1
- data/doc/guide/pre_built_components/new.md +2 -2
- data/doc/guide/pre_built_components/show.md +1 -1
- data/doc/guide/pre_built_components/with_form.md +1 -1
- data/doc/guide/pre_built_components.md +4 -3
- data/doc/guide/resourceful.md +5 -3
- data/doc/guide/standalone.md +10 -2
- data/doc/guide/virtual_models.md +4 -2
- data/doc/index.html +11 -18
- data/doc/method_list.html +273 -161
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component.rb +19 -48
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +2 -2
- data/lib/compony/component_mixins/default/standalone.rb +16 -0
- data/lib/compony/component_mixins/resourceful.rb +1 -1
- data/lib/compony/components/buttons/css_button.rb +32 -0
- data/lib/compony/components/buttons/link.rb +31 -0
- data/lib/compony/components/destroy.rb +9 -8
- data/lib/compony/components/edit.rb +5 -4
- data/lib/compony/components/form.rb +7 -1
- data/lib/compony/components/index.rb +2 -2
- data/lib/compony/components/list.rb +4 -4
- data/lib/compony/components/new.rb +1 -1
- data/lib/compony/components/show.rb +8 -11
- data/lib/compony/components/with_form.rb +1 -1
- data/lib/compony/exposed_intents_dsl.rb +29 -0
- data/lib/compony/intent.rb +145 -0
- data/lib/compony/model_fields/association.rb +1 -1
- data/lib/compony/request_context.rb +21 -0
- data/lib/compony/view_helpers.rb +5 -48
- data/lib/compony.rb +63 -149
- metadata +12 -6
- data/doc/guide/helpers.md +0 -156
- data/doc/guide/pre_built_components/button.md +0 -8
- data/doc/guide/root_actions.md +0 -67
- data/lib/compony/components/button.rb +0 -61
data/doc/Compony/Component.html
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
|
|
111
111
|
</div><div id="subclasses">
|
|
112
112
|
<h2>Direct Known Subclasses</h2>
|
|
113
|
-
<p class="children"><span class='object_link'><a href="Components/
|
|
113
|
+
<p class="children"><span class='object_link'><a href="Components/Buttons/Link.html" title="Compony::Components::Buttons::Link (class)">Compony::Components::Buttons::Link</a></span>, <span class='object_link'><a href="Components/Destroy.html" title="Compony::Components::Destroy (class)">Compony::Components::Destroy</a></span>, <span class='object_link'><a href="Components/Form.html" title="Compony::Components::Form (class)">Compony::Components::Form</a></span>, <span class='object_link'><a href="Components/Index.html" title="Compony::Components::Index (class)">Compony::Components::Index</a></span>, <span class='object_link'><a href="Components/List.html" title="Compony::Components::List (class)">Compony::Components::List</a></span>, <span class='object_link'><a href="Components/Show.html" title="Compony::Components::Show (class)">Compony::Components::Show</a></span>, <span class='object_link'><a href="Components/WithForm.html" title="Compony::Components::WithForm (class)">Compony::Components::WithForm</a></span></p>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
|
|
@@ -218,30 +218,6 @@
|
|
|
218
218
|
<li class="public ">
|
|
219
219
|
<span class="summary_signature">
|
|
220
220
|
|
|
221
|
-
<a href="#comp_cst-class_method" title="comp_cst (class method)">.<strong>comp_cst</strong> ⇒ Object </a>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
</span>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
<span class="summary_desc"><div class='inline'>
|
|
236
|
-
<p>Returns the name of the class constant of this component.</p>
|
|
237
|
-
</div></span>
|
|
238
|
-
|
|
239
|
-
</li>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
<li class="public ">
|
|
243
|
-
<span class="summary_signature">
|
|
244
|
-
|
|
245
221
|
<a href="#comp_name-class_method" title="comp_name (class method)">.<strong>comp_name</strong> ⇒ Object </a>
|
|
246
222
|
|
|
247
223
|
|
|
@@ -260,30 +236,6 @@
|
|
|
260
236
|
<p>Returns the component name.</p>
|
|
261
237
|
</div></span>
|
|
262
238
|
|
|
263
|
-
</li>
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
<li class="public ">
|
|
267
|
-
<span class="summary_signature">
|
|
268
|
-
|
|
269
|
-
<a href="#family_cst-class_method" title="family_cst (class method)">.<strong>family_cst</strong> ⇒ Object </a>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
</span>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
<span class="summary_desc"><div class='inline'>
|
|
284
|
-
<p>Returns the name of the module constant (=family) of this component.</p>
|
|
285
|
-
</div></span>
|
|
286
|
-
|
|
287
239
|
</li>
|
|
288
240
|
|
|
289
241
|
|
|
@@ -347,7 +299,7 @@
|
|
|
347
299
|
<li class="public ">
|
|
348
300
|
<span class="summary_signature">
|
|
349
301
|
|
|
350
|
-
<a href="#
|
|
302
|
+
<a href="#before_render-instance_method" title="#before_render (instance method)">#<strong>before_render</strong>(name = :main, before: nil, &block) ⇒ Object </a>
|
|
351
303
|
|
|
352
304
|
|
|
353
305
|
|
|
@@ -362,7 +314,7 @@
|
|
|
362
314
|
|
|
363
315
|
|
|
364
316
|
<span class="summary_desc"><div class='inline'>
|
|
365
|
-
<p>DSL method Adds or
|
|
317
|
+
<p>DSL method Adds or overrides a before_render block.</p>
|
|
366
318
|
</div></span>
|
|
367
319
|
|
|
368
320
|
</li>
|
|
@@ -371,7 +323,7 @@
|
|
|
371
323
|
<li class="public ">
|
|
372
324
|
<span class="summary_signature">
|
|
373
325
|
|
|
374
|
-
<a href="#
|
|
326
|
+
<a href="#content-instance_method" title="#content (instance method)">#<strong>content</strong>(name = :main, before: nil, &block) ⇒ Object </a>
|
|
375
327
|
|
|
376
328
|
|
|
377
329
|
|
|
@@ -386,7 +338,7 @@
|
|
|
386
338
|
|
|
387
339
|
|
|
388
340
|
<span class="summary_desc"><div class='inline'>
|
|
389
|
-
<p>DSL method Adds or overrides a
|
|
341
|
+
<p>DSL method Adds or overrides a content block.</p>
|
|
390
342
|
</div></span>
|
|
391
343
|
|
|
392
344
|
</li>
|
|
@@ -395,7 +347,7 @@
|
|
|
395
347
|
<li class="public ">
|
|
396
348
|
<span class="summary_signature">
|
|
397
349
|
|
|
398
|
-
<a href="#
|
|
350
|
+
<a href="#exposed_intents-instance_method" title="#exposed_intents (instance method)">#<strong>exposed_intents</strong>(&block) ⇒ Object </a>
|
|
399
351
|
|
|
400
352
|
|
|
401
353
|
|
|
@@ -410,7 +362,7 @@
|
|
|
410
362
|
|
|
411
363
|
|
|
412
364
|
<span class="summary_desc"><div class='inline'>
|
|
413
|
-
<p>DSL method
|
|
365
|
+
<p>DSL method If a block is given: Enters the DSL where exposed intents can be added or removed (use from <span class='object_link'><a href="#setup-class_method" title="Compony::Component.setup (method)">Component.setup</a></span> within the component).</p>
|
|
414
366
|
</div></span>
|
|
415
367
|
|
|
416
368
|
</li>
|
|
@@ -653,30 +605,6 @@
|
|
|
653
605
|
<p>Renders the component using the controller passsed to it and returns it as a string.</p>
|
|
654
606
|
</div></span>
|
|
655
607
|
|
|
656
|
-
</li>
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
<li class="public ">
|
|
660
|
-
<span class="summary_signature">
|
|
661
|
-
|
|
662
|
-
<a href="#render_actions-instance_method" title="#render_actions (instance method)">#<strong>render_actions</strong>(controller, wrapper_class: '', action_class: '') ⇒ Object </a>
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
</span>
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
<span class="summary_desc"><div class='inline'>
|
|
677
|
-
<p>Used to render all actions of this component, each button wrapped in a div with the specified class.</p>
|
|
678
|
-
</div></span>
|
|
679
|
-
|
|
680
608
|
</li>
|
|
681
609
|
|
|
682
610
|
|
|
@@ -755,31 +683,7 @@
|
|
|
755
683
|
<li class="public ">
|
|
756
684
|
<span class="summary_signature">
|
|
757
685
|
|
|
758
|
-
<a href="#
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
</span>
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
<span class="summary_desc"><div class='inline'>
|
|
773
|
-
<p>DSL method Marks an action for skip.</p>
|
|
774
|
-
</div></span>
|
|
775
|
-
|
|
776
|
-
</li>
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
<li class="public ">
|
|
780
|
-
<span class="summary_signature">
|
|
781
|
-
|
|
782
|
-
<a href="#sub_comp-instance_method" title="#sub_comp (instance method)">#<strong>sub_comp</strong>(component_class, **comp_opts) ⇒ Object </a>
|
|
686
|
+
<a href="#sub_comp-instance_method" title="#sub_comp (instance method)">#<strong>sub_comp</strong>(**comp_opts) ⇒ Object </a>
|
|
783
687
|
|
|
784
688
|
|
|
785
689
|
|
|
@@ -832,6 +736,16 @@
|
|
|
832
736
|
<pre class="lines">
|
|
833
737
|
|
|
834
738
|
|
|
739
|
+
33
|
|
740
|
+
34
|
|
741
|
+
35
|
|
742
|
+
36
|
|
743
|
+
37
|
|
744
|
+
38
|
|
745
|
+
39
|
|
746
|
+
40
|
|
747
|
+
41
|
|
748
|
+
42
|
|
835
749
|
43
|
|
836
750
|
44
|
|
837
751
|
45
|
|
@@ -849,19 +763,10 @@
|
|
|
849
763
|
57
|
|
850
764
|
58
|
|
851
765
|
59
|
|
852
|
-
60
|
|
853
|
-
61
|
|
854
|
-
62
|
|
855
|
-
63
|
|
856
|
-
64
|
|
857
|
-
65
|
|
858
|
-
66
|
|
859
|
-
67
|
|
860
|
-
68
|
|
861
|
-
69</pre>
|
|
766
|
+
60</pre>
|
|
862
767
|
</td>
|
|
863
768
|
<td>
|
|
864
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
769
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 33</span>
|
|
865
770
|
|
|
866
771
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_comp'>parent_comp</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>index:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_comp_opts'>comp_opts</span><span class='rparen'>)</span>
|
|
867
772
|
<span class='ivar'>@parent_comp</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_comp'>parent_comp</span>
|
|
@@ -871,11 +776,12 @@
|
|
|
871
776
|
<span class='ivar'>@before_render_blocks</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
872
777
|
<span class='ivar'>@content_blocks</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
873
778
|
<span class='ivar'>@actions</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
779
|
+
<span class='ivar'>@exposed_intent_blocks</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
874
780
|
<span class='ivar'>@skipped_actions</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
875
781
|
<span class='ivar'>@path_block</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_model'>model</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args_for_path_helper'>args_for_path_helper</span><span class='comma'>,</span> <span class='label'>standalone_name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs_for_path_helper'>kwargs_for_path_helper</span><span class='op'>|</span>
|
|
876
782
|
<span class='id identifier rubyid_kwargs_for_path_helper'>kwargs_for_path_helper</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='label'>id:</span> <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_model'>model</span>
|
|
877
783
|
<span class='kw'>next</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_routes'>routes</span><span class='period'>.</span><span class='id identifier rubyid_url_helpers'>url_helpers</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span>
|
|
878
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='
|
|
784
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_helper_name'>path_helper_name</span><span class='lparen'>(</span><span class='id identifier rubyid_standalone_name'>standalone_name</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>_path</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
879
785
|
<span class='op'>*</span><span class='id identifier rubyid_args_for_path_helper'>args_for_path_helper</span><span class='comma'>,</span>
|
|
880
786
|
<span class='op'>**</span><span class='id identifier rubyid_kwargs_for_path_helper'>kwargs_for_path_helper</span>
|
|
881
787
|
<span class='rparen'>)</span>
|
|
@@ -1033,48 +939,7 @@
|
|
|
1033
939
|
|
|
1034
940
|
|
|
1035
941
|
<div class="method_details first">
|
|
1036
|
-
<h3 class="signature first" id="
|
|
1037
|
-
|
|
1038
|
-
.<strong>comp_cst</strong> ⇒ <tt>Object</tt>
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
</h3><div class="docstring">
|
|
1045
|
-
<div class="discussion">
|
|
1046
|
-
|
|
1047
|
-
<p>Returns the name of the class constant of this component. Do not override.</p>
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
</div>
|
|
1051
|
-
</div>
|
|
1052
|
-
<div class="tags">
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
</div><table class="source_code">
|
|
1056
|
-
<tr>
|
|
1057
|
-
<td>
|
|
1058
|
-
<pre class="lines">
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
34
|
|
1062
|
-
35
|
|
1063
|
-
36</pre>
|
|
1064
|
-
</td>
|
|
1065
|
-
<td>
|
|
1066
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 34</span>
|
|
1067
|
-
|
|
1068
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_comp_cst'>comp_cst</span>
|
|
1069
|
-
<span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_demodulize'>demodulize</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
1070
|
-
<span class='kw'>end</span></pre>
|
|
1071
|
-
</td>
|
|
1072
|
-
</tr>
|
|
1073
|
-
</table>
|
|
1074
|
-
</div>
|
|
1075
|
-
|
|
1076
|
-
<div class="method_details ">
|
|
1077
|
-
<h3 class="signature " id="comp_name-class_method">
|
|
942
|
+
<h3 class="signature first" id="comp_name-class_method">
|
|
1078
943
|
|
|
1079
944
|
.<strong>comp_name</strong> ⇒ <tt>Object</tt>
|
|
1080
945
|
|
|
@@ -1099,15 +964,15 @@
|
|
|
1099
964
|
<pre class="lines">
|
|
1100
965
|
|
|
1101
966
|
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
967
|
+
29
|
|
968
|
+
30
|
|
969
|
+
31</pre>
|
|
1105
970
|
</td>
|
|
1106
971
|
<td>
|
|
1107
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
972
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 29</span>
|
|
1108
973
|
|
|
1109
974
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_comp_name'>comp_name</span>
|
|
1110
|
-
<span class='id identifier
|
|
975
|
+
<span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_demodulize'>demodulize</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span>
|
|
1111
976
|
<span class='kw'>end</span></pre>
|
|
1112
977
|
</td>
|
|
1113
978
|
</tr>
|
|
@@ -1115,9 +980,9 @@
|
|
|
1115
980
|
</div>
|
|
1116
981
|
|
|
1117
982
|
<div class="method_details ">
|
|
1118
|
-
<h3 class="signature " id="
|
|
983
|
+
<h3 class="signature " id="family_name-class_method">
|
|
1119
984
|
|
|
1120
|
-
.<strong>
|
|
985
|
+
.<strong>family_name</strong> ⇒ <tt>Object</tt>
|
|
1121
986
|
|
|
1122
987
|
|
|
1123
988
|
|
|
@@ -1126,7 +991,7 @@
|
|
|
1126
991
|
</h3><div class="docstring">
|
|
1127
992
|
<div class="discussion">
|
|
1128
993
|
|
|
1129
|
-
<p>Returns the
|
|
994
|
+
<p>Returns the family name</p>
|
|
1130
995
|
|
|
1131
996
|
|
|
1132
997
|
</div>
|
|
@@ -1147,49 +1012,8 @@
|
|
|
1147
1012
|
<td>
|
|
1148
1013
|
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 24</span>
|
|
1149
1014
|
|
|
1150
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_family_cst'>family_cst</span>
|
|
1151
|
-
<span class='id identifier rubyid_module_parent'>module_parent</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_demodulize'>demodulize</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
1152
|
-
<span class='kw'>end</span></pre>
|
|
1153
|
-
</td>
|
|
1154
|
-
</tr>
|
|
1155
|
-
</table>
|
|
1156
|
-
</div>
|
|
1157
|
-
|
|
1158
|
-
<div class="method_details ">
|
|
1159
|
-
<h3 class="signature " id="family_name-class_method">
|
|
1160
|
-
|
|
1161
|
-
.<strong>family_name</strong> ⇒ <tt>Object</tt>
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
</h3><div class="docstring">
|
|
1168
|
-
<div class="discussion">
|
|
1169
|
-
|
|
1170
|
-
<p>Returns the family name</p>
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
</div>
|
|
1174
|
-
</div>
|
|
1175
|
-
<div class="tags">
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
</div><table class="source_code">
|
|
1179
|
-
<tr>
|
|
1180
|
-
<td>
|
|
1181
|
-
<pre class="lines">
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
29
|
|
1185
|
-
30
|
|
1186
|
-
31</pre>
|
|
1187
|
-
</td>
|
|
1188
|
-
<td>
|
|
1189
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 29</span>
|
|
1190
|
-
|
|
1191
1015
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_family_name'>family_name</span>
|
|
1192
|
-
<span class='id identifier
|
|
1016
|
+
<span class='id identifier rubyid_module_parent'>module_parent</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_demodulize'>demodulize</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span>
|
|
1193
1017
|
<span class='kw'>end</span></pre>
|
|
1194
1018
|
</td>
|
|
1195
1019
|
</tr>
|
|
@@ -1250,48 +1074,7 @@
|
|
|
1250
1074
|
|
|
1251
1075
|
|
|
1252
1076
|
<div class="method_details first">
|
|
1253
|
-
<h3 class="signature first" id="
|
|
1254
|
-
|
|
1255
|
-
#<strong>action</strong>(action_name, before: nil, &block) ⇒ <tt>Object</tt>
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
</h3><div class="docstring">
|
|
1262
|
-
<div class="discussion">
|
|
1263
|
-
|
|
1264
|
-
<p>DSL method Adds or replaces an action (for action buttons) If before: is specified, will insert the action before the named action. When replacing, an element keeps its position unless before: is specified.</p>
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
</div>
|
|
1268
|
-
</div>
|
|
1269
|
-
<div class="tags">
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
</div><table class="source_code">
|
|
1273
|
-
<tr>
|
|
1274
|
-
<td>
|
|
1275
|
-
<pre class="lines">
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
232
|
|
1279
|
-
233
|
|
1280
|
-
234</pre>
|
|
1281
|
-
</td>
|
|
1282
|
-
<td>
|
|
1283
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 232</span>
|
|
1284
|
-
|
|
1285
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1286
|
-
<span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_natural_push'>natural_push</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='comma'>,</span> <span class='label'>before:</span><span class='rparen'>)</span>
|
|
1287
|
-
<span class='kw'>end</span></pre>
|
|
1288
|
-
</td>
|
|
1289
|
-
</tr>
|
|
1290
|
-
</table>
|
|
1291
|
-
</div>
|
|
1292
|
-
|
|
1293
|
-
<div class="method_details ">
|
|
1294
|
-
<h3 class="signature " id="before_render-instance_method">
|
|
1077
|
+
<h3 class="signature first" id="before_render-instance_method">
|
|
1295
1078
|
|
|
1296
1079
|
#<strong>before_render</strong>(name = :main, before: nil, &block) ⇒ <tt>Object</tt>
|
|
1297
1080
|
|
|
@@ -1372,13 +1155,13 @@
|
|
|
1372
1155
|
<pre class="lines">
|
|
1373
1156
|
|
|
1374
1157
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1158
|
+
141
|
|
1159
|
+
142
|
|
1160
|
+
143
|
|
1161
|
+
144</pre>
|
|
1379
1162
|
</td>
|
|
1380
1163
|
<td>
|
|
1381
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1164
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 141</span>
|
|
1382
1165
|
|
|
1383
1166
|
<span class='kw'>def</span> <span class='id identifier rubyid_before_render'>before_render</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='symbol'>:main</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1384
1167
|
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>`before_render` expects a block in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
@@ -1487,16 +1270,16 @@
|
|
|
1487
1270
|
<pre class="lines">
|
|
1488
1271
|
|
|
1489
1272
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1273
|
+
152
|
|
1274
|
+
153
|
|
1275
|
+
154
|
|
1276
|
+
155
|
|
1277
|
+
156
|
|
1278
|
+
157
|
|
1279
|
+
158</pre>
|
|
1497
1280
|
</td>
|
|
1498
1281
|
<td>
|
|
1499
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1282
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 152</span>
|
|
1500
1283
|
|
|
1501
1284
|
<span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='symbol'>:main</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1502
1285
|
<span class='comment'># A block is required here, but if this is an override (e.g. to hide another content block), we can tolerate the missing block.
|
|
@@ -1508,6 +1291,65 @@
|
|
|
1508
1291
|
</td>
|
|
1509
1292
|
</tr>
|
|
1510
1293
|
</table>
|
|
1294
|
+
</div>
|
|
1295
|
+
|
|
1296
|
+
<div class="method_details ">
|
|
1297
|
+
<h3 class="signature " id="exposed_intents-instance_method">
|
|
1298
|
+
|
|
1299
|
+
#<strong>exposed_intents</strong>(&block) ⇒ <tt>Object</tt>
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
</h3><div class="docstring">
|
|
1306
|
+
<div class="discussion">
|
|
1307
|
+
|
|
1308
|
+
<p>DSL method If a block is given: Enters the DSL where exposed intents can be added or removed (use from <span class='object_link'><a href="#setup-class_method" title="Compony::Component.setup (method)">setup</a></span> within the component). If no block is given: Builds the declared intents and returns them (use from a RequestContest outside the component).</p>
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
<div class="tags">
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
</div><table class="source_code">
|
|
1317
|
+
<tr>
|
|
1318
|
+
<td>
|
|
1319
|
+
<pre class="lines">
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
218
|
|
1323
|
+
219
|
|
1324
|
+
220
|
|
1325
|
+
221
|
|
1326
|
+
222
|
|
1327
|
+
223
|
|
1328
|
+
224
|
|
1329
|
+
225
|
|
1330
|
+
226
|
|
1331
|
+
227
|
|
1332
|
+
228
|
|
1333
|
+
229</pre>
|
|
1334
|
+
</td>
|
|
1335
|
+
<td>
|
|
1336
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 218</span>
|
|
1337
|
+
|
|
1338
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_exposed_intents'>exposed_intents</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1339
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
1340
|
+
<span class='comment'># Enter DSL
|
|
1341
|
+
</span> <span class='ivar'>@exposed_intent_blocks</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span>
|
|
1342
|
+
<span class='kw'>else</span>
|
|
1343
|
+
<span class='comment'># Build the declared intents
|
|
1344
|
+
</span> <span class='kw'>return</span> <span class='ivar'>@exposed_intents</span> <span class='kw'>if</span> <span class='ivar'>@exposed_intents</span>
|
|
1345
|
+
<span class='ivar'>@exposed_intents</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1346
|
+
<span class='ivar'>@exposed_intent_blocks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_block'>block</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="ExposedIntentsDsl.html" title="Compony::ExposedIntentsDsl (class)">ExposedIntentsDsl</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ExposedIntentsDsl.html#initialize-instance_method" title="Compony::ExposedIntentsDsl#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@exposed_intents</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='comment'># alters @exposed_intents
|
|
1347
|
+
</span> <span class='kw'>return</span> <span class='ivar'>@exposed_intents</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:payload</span><span class='rparen'>)</span>
|
|
1348
|
+
<span class='kw'>end</span>
|
|
1349
|
+
<span class='kw'>end</span></pre>
|
|
1350
|
+
</td>
|
|
1351
|
+
</tr>
|
|
1352
|
+
</table>
|
|
1511
1353
|
</div>
|
|
1512
1354
|
|
|
1513
1355
|
<div class="method_details ">
|
|
@@ -1536,12 +1378,12 @@
|
|
|
1536
1378
|
<pre class="lines">
|
|
1537
1379
|
|
|
1538
1380
|
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1381
|
+
81
|
|
1382
|
+
82
|
|
1383
|
+
83</pre>
|
|
1542
1384
|
</td>
|
|
1543
1385
|
<td>
|
|
1544
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1386
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 81</span>
|
|
1545
1387
|
|
|
1546
1388
|
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
|
|
1547
1389
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_family_name'>family_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='ivar'>@index</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
@@ -1577,16 +1419,16 @@
|
|
|
1577
1419
|
<pre class="lines">
|
|
1578
1420
|
|
|
1579
1421
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1422
|
+
87
|
|
1423
|
+
88
|
|
1424
|
+
89
|
|
1425
|
+
90
|
|
1426
|
+
91
|
|
1427
|
+
92
|
|
1428
|
+
93</pre>
|
|
1587
1429
|
</td>
|
|
1588
1430
|
<td>
|
|
1589
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1431
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 87</span>
|
|
1590
1432
|
|
|
1591
1433
|
<span class='kw'>def</span> <span class='id identifier rubyid_id_path'>id_path</span>
|
|
1592
1434
|
<span class='kw'>if</span> <span class='id identifier rubyid_root_comp?'>root_comp?</span>
|
|
@@ -1626,12 +1468,12 @@
|
|
|
1626
1468
|
<pre class="lines">
|
|
1627
1469
|
|
|
1628
1470
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1471
|
+
97
|
|
1472
|
+
98
|
|
1473
|
+
99</pre>
|
|
1632
1474
|
</td>
|
|
1633
1475
|
<td>
|
|
1634
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1476
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 97</span>
|
|
1635
1477
|
|
|
1636
1478
|
<span class='kw'>def</span> <span class='id identifier rubyid_id_path_hash'>id_path_hash</span>
|
|
1637
1479
|
<span class='const'>Digest</span><span class='op'>::</span><span class='const'>SHA1</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='id identifier rubyid_id_path'>id_path</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='op'>..</span><span class='int'>4</span><span class='rbracket'>]</span>
|
|
@@ -1665,12 +1507,12 @@
|
|
|
1665
1507
|
<pre class="lines">
|
|
1666
1508
|
|
|
1667
1509
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1510
|
+
62
|
|
1511
|
+
63
|
|
1512
|
+
64</pre>
|
|
1671
1513
|
</td>
|
|
1672
1514
|
<td>
|
|
1673
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1515
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 62</span>
|
|
1674
1516
|
|
|
1675
1517
|
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
|
|
1676
1518
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>#<</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hash'>hash</span><span class='embexpr_end'>}</span><span class='tstring_content'>></span><span class='tstring_end'>"</span></span>
|
|
@@ -1706,12 +1548,12 @@
|
|
|
1706
1548
|
<pre class="lines">
|
|
1707
1549
|
|
|
1708
1550
|
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1551
|
+
103
|
|
1552
|
+
104
|
|
1553
|
+
105</pre>
|
|
1712
1554
|
</td>
|
|
1713
1555
|
<td>
|
|
1714
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1556
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 103</span>
|
|
1715
1557
|
|
|
1716
1558
|
<span class='kw'>def</span> <span class='id identifier rubyid_param_name'>param_name</span><span class='lparen'>(</span><span class='id identifier rubyid_unprefixed_param_name'>unprefixed_param_name</span><span class='rparen'>)</span>
|
|
1717
1559
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id_path_hash'>id_path_hash</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_unprefixed_param_name'>unprefixed_param_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
@@ -1747,17 +1589,17 @@
|
|
|
1747
1589
|
<pre class="lines">
|
|
1748
1590
|
|
|
1749
1591
|
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1592
|
+
126
|
|
1593
|
+
127
|
|
1594
|
+
128
|
|
1595
|
+
129
|
|
1596
|
+
130
|
|
1597
|
+
131
|
|
1598
|
+
132
|
|
1599
|
+
133</pre>
|
|
1758
1600
|
</td>
|
|
1759
1601
|
<td>
|
|
1760
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1602
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 126</span>
|
|
1761
1603
|
|
|
1762
1604
|
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='op'>*</span><span class='comma'>,</span> <span class='op'>**</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1763
1605
|
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
@@ -1818,18 +1660,18 @@
|
|
|
1818
1660
|
<pre class="lines">
|
|
1819
1661
|
|
|
1820
1662
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1663
|
+
163
|
|
1664
|
+
164
|
|
1665
|
+
165
|
|
1666
|
+
166
|
|
1667
|
+
167
|
|
1668
|
+
168
|
|
1669
|
+
169
|
|
1670
|
+
170
|
|
1671
|
+
171</pre>
|
|
1830
1672
|
</td>
|
|
1831
1673
|
<td>
|
|
1832
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1674
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 163</span>
|
|
1833
1675
|
|
|
1834
1676
|
<span class='kw'>def</span> <span class='id identifier rubyid_remove_content'>remove_content</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='comment'># rubocop:disable Naming/PredicateMethod
|
|
1835
1677
|
</span> <span class='id identifier rubyid_existing_index'>existing_index</span> <span class='op'>=</span> <span class='ivar'>@content_blocks</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_el'>el</span><span class='op'>|</span> <span class='id identifier rubyid_el'>el</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='rbrace'>}</span>
|
|
@@ -1891,12 +1733,12 @@
|
|
|
1891
1733
|
<pre class="lines">
|
|
1892
1734
|
|
|
1893
1735
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1736
|
+
176
|
|
1737
|
+
177
|
|
1738
|
+
178</pre>
|
|
1897
1739
|
</td>
|
|
1898
1740
|
<td>
|
|
1899
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1741
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 176</span>
|
|
1900
1742
|
|
|
1901
1743
|
<span class='kw'>def</span> <span class='id identifier rubyid_remove_content!'>remove_content!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
1902
1744
|
<span class='id identifier rubyid_remove_content'>remove_content</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Content block </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> not found for removal in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
@@ -1954,6 +1796,20 @@
|
|
|
1954
1796
|
<pre class="lines">
|
|
1955
1797
|
|
|
1956
1798
|
|
|
1799
|
+
183
|
|
1800
|
+
184
|
|
1801
|
+
185
|
|
1802
|
+
186
|
|
1803
|
+
187
|
|
1804
|
+
188
|
|
1805
|
+
189
|
|
1806
|
+
190
|
|
1807
|
+
191
|
|
1808
|
+
192
|
|
1809
|
+
193
|
|
1810
|
+
194
|
|
1811
|
+
195
|
|
1812
|
+
196
|
|
1957
1813
|
197
|
|
1958
1814
|
198
|
|
1959
1815
|
199
|
|
@@ -1970,24 +1826,10 @@
|
|
|
1970
1826
|
210
|
|
1971
1827
|
211
|
|
1972
1828
|
212
|
|
1973
|
-
213
|
|
1974
|
-
214
|
|
1975
|
-
215
|
|
1976
|
-
216
|
|
1977
|
-
217
|
|
1978
|
-
218
|
|
1979
|
-
219
|
|
1980
|
-
220
|
|
1981
|
-
221
|
|
1982
|
-
222
|
|
1983
|
-
223
|
|
1984
|
-
224
|
|
1985
|
-
225
|
|
1986
|
-
226
|
|
1987
|
-
227</pre>
|
|
1829
|
+
213</pre>
|
|
1988
1830
|
</td>
|
|
1989
1831
|
<td>
|
|
1990
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1832
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 183</span>
|
|
1991
1833
|
|
|
1992
1834
|
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='comma'>,</span> <span class='label'>standalone:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_locals'>locals</span><span class='rparen'>)</span>
|
|
1993
1835
|
<span class='comment'># Call before_render hooks (if any) and backfire instance variables back to the component
|
|
@@ -2023,73 +1865,6 @@
|
|
|
2023
1865
|
</td>
|
|
2024
1866
|
</tr>
|
|
2025
1867
|
</table>
|
|
2026
|
-
</div>
|
|
2027
|
-
|
|
2028
|
-
<div class="method_details ">
|
|
2029
|
-
<h3 class="signature " id="render_actions-instance_method">
|
|
2030
|
-
|
|
2031
|
-
#<strong>render_actions</strong>(controller, wrapper_class: '', action_class: '') ⇒ <tt>Object</tt>
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
</h3><div class="docstring">
|
|
2038
|
-
<div class="discussion">
|
|
2039
|
-
|
|
2040
|
-
<p>Used to render all actions of this component, each button wrapped in a div with the specified class</p>
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
</div>
|
|
2044
|
-
</div>
|
|
2045
|
-
<div class="tags">
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
</div><table class="source_code">
|
|
2049
|
-
<tr>
|
|
2050
|
-
<td>
|
|
2051
|
-
<pre class="lines">
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
243
|
|
2055
|
-
244
|
|
2056
|
-
245
|
|
2057
|
-
246
|
|
2058
|
-
247
|
|
2059
|
-
248
|
|
2060
|
-
249
|
|
2061
|
-
250
|
|
2062
|
-
251
|
|
2063
|
-
252
|
|
2064
|
-
253
|
|
2065
|
-
254
|
|
2066
|
-
255
|
|
2067
|
-
256
|
|
2068
|
-
257
|
|
2069
|
-
258</pre>
|
|
2070
|
-
</td>
|
|
2071
|
-
<td>
|
|
2072
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 243</span>
|
|
2073
|
-
|
|
2074
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_render_actions'>render_actions</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='comma'>,</span> <span class='label'>wrapper_class:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>action_class:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
2075
|
-
<span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
|
|
2076
|
-
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='id identifier rubyid_wrapper_class'>wrapper_class</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
|
2077
|
-
<span class='id identifier rubyid_button_htmls'>button_htmls</span> <span class='op'>=</span> <span class='ivar'>@actions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_action'>action</span><span class='op'>|</span>
|
|
2078
|
-
<span class='kw'>next</span> <span class='kw'>if</span> <span class='ivar'>@skipped_actions</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
2079
|
-
<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_with_button_defaults'><span class='object_link'><a href="../Compony.html#with_button_defaults-class_method" title="Compony.with_button_defaults (method)">with_button_defaults</a></span></span><span class='lparen'>(</span><span class='label'>feasibility_action:</span> <span class='id identifier rubyid_action'>action</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
|
2080
|
-
<span class='id identifier rubyid_action_button'>action_button</span> <span class='op'>=</span> <span class='id identifier rubyid_action'>action</span><span class='period'>.</span><span class='id identifier rubyid_payload'>payload</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
|
|
2081
|
-
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_action_button'>action_button</span>
|
|
2082
|
-
<span class='id identifier rubyid_button_html'>button_html</span> <span class='op'>=</span> <span class='id identifier rubyid_action_button'>action_button</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
|
|
2083
|
-
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_button_html'>button_html</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
|
2084
|
-
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='id identifier rubyid_button_html'>button_html</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='id identifier rubyid_action_class'>action_class</span><span class='rparen'>)</span>
|
|
2085
|
-
<span class='kw'>end</span>
|
|
2086
|
-
<span class='kw'>end</span>
|
|
2087
|
-
<span class='kw'>next</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_safe_join'>safe_join</span> <span class='id identifier rubyid_button_htmls'>button_htmls</span>
|
|
2088
|
-
<span class='kw'>end</span>
|
|
2089
|
-
<span class='kw'>end</span></pre>
|
|
2090
|
-
</td>
|
|
2091
|
-
</tr>
|
|
2092
|
-
</table>
|
|
2093
1868
|
</div>
|
|
2094
1869
|
|
|
2095
1870
|
<div class="method_details ">
|
|
@@ -2131,12 +1906,12 @@
|
|
|
2131
1906
|
<pre class="lines">
|
|
2132
1907
|
|
|
2133
1908
|
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
1909
|
+
232
|
|
1910
|
+
233
|
|
1911
|
+
234</pre>
|
|
2137
1912
|
</td>
|
|
2138
1913
|
<td>
|
|
2139
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1914
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 232</span>
|
|
2140
1915
|
|
|
2141
1916
|
<span class='kw'>def</span> <span class='id identifier rubyid_resourceful?'>resourceful?</span>
|
|
2142
1917
|
<span class='kw'>return</span> <span class='kw'>false</span>
|
|
@@ -2172,13 +1947,13 @@
|
|
|
2172
1947
|
<pre class="lines">
|
|
2173
1948
|
|
|
2174
1949
|
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
1950
|
+
68
|
|
1951
|
+
69
|
|
1952
|
+
70
|
|
1953
|
+
71</pre>
|
|
2179
1954
|
</td>
|
|
2180
1955
|
<td>
|
|
2181
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
1956
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 68</span>
|
|
2182
1957
|
|
|
2183
1958
|
<span class='kw'>def</span> <span class='id identifier rubyid_root_comp'>root_comp</span>
|
|
2184
1959
|
<span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_parent_comp'>parent_comp</span>
|
|
@@ -2228,12 +2003,12 @@
|
|
|
2228
2003
|
<pre class="lines">
|
|
2229
2004
|
|
|
2230
2005
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2006
|
+
75
|
|
2007
|
+
76
|
|
2008
|
+
77</pre>
|
|
2234
2009
|
</td>
|
|
2235
2010
|
<td>
|
|
2236
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
2011
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 75</span>
|
|
2237
2012
|
|
|
2238
2013
|
<span class='kw'>def</span> <span class='id identifier rubyid_root_comp?'>root_comp?</span>
|
|
2239
2014
|
<span class='id identifier rubyid_parent_comp'>parent_comp</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
@@ -2241,53 +2016,12 @@
|
|
|
2241
2016
|
</td>
|
|
2242
2017
|
</tr>
|
|
2243
2018
|
</table>
|
|
2244
|
-
</div>
|
|
2245
|
-
|
|
2246
|
-
<div class="method_details ">
|
|
2247
|
-
<h3 class="signature " id="skip_action-instance_method">
|
|
2248
|
-
|
|
2249
|
-
#<strong>skip_action</strong>(action_name) ⇒ <tt>Object</tt>
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
</h3><div class="docstring">
|
|
2256
|
-
<div class="discussion">
|
|
2257
|
-
|
|
2258
|
-
<p>DSL method Marks an action for skip</p>
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
</div>
|
|
2262
|
-
</div>
|
|
2263
|
-
<div class="tags">
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
</div><table class="source_code">
|
|
2267
|
-
<tr>
|
|
2268
|
-
<td>
|
|
2269
|
-
<pre class="lines">
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
238
|
|
2273
|
-
239
|
|
2274
|
-
240</pre>
|
|
2275
|
-
</td>
|
|
2276
|
-
<td>
|
|
2277
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 238</span>
|
|
2278
|
-
|
|
2279
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_skip_action'>skip_action</span><span class='lparen'>(</span><span class='id identifier rubyid_action_name'>action_name</span><span class='rparen'>)</span>
|
|
2280
|
-
<span class='ivar'>@skipped_actions</span> <span class='op'><<</span> <span class='id identifier rubyid_action_name'>action_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
2281
|
-
<span class='kw'>end</span></pre>
|
|
2282
|
-
</td>
|
|
2283
|
-
</tr>
|
|
2284
|
-
</table>
|
|
2285
2019
|
</div>
|
|
2286
2020
|
|
|
2287
2021
|
<div class="method_details ">
|
|
2288
2022
|
<h3 class="signature " id="sub_comp-instance_method">
|
|
2289
2023
|
|
|
2290
|
-
#<strong>sub_comp</strong>(
|
|
2024
|
+
#<strong>sub_comp</strong>(**comp_opts) ⇒ <tt>Object</tt>
|
|
2291
2025
|
|
|
2292
2026
|
|
|
2293
2027
|
|
|
@@ -2310,17 +2044,19 @@
|
|
|
2310
2044
|
<pre class="lines">
|
|
2311
2045
|
|
|
2312
2046
|
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2047
|
+
108
|
|
2048
|
+
109
|
|
2049
|
+
110
|
|
2050
|
+
111
|
|
2051
|
+
112
|
|
2052
|
+
113</pre>
|
|
2318
2053
|
</td>
|
|
2319
2054
|
<td>
|
|
2320
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line
|
|
2055
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component.rb', line 108</span>
|
|
2321
2056
|
|
|
2322
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_sub_comp'>sub_comp</span><span class='lparen'>(</span><span class='
|
|
2323
|
-
<span class='id identifier
|
|
2057
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sub_comp'>sub_comp</span><span class='lparen'>(</span><span class='op'>*</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_comp_opts'>comp_opts</span><span class='rparen'>)</span>
|
|
2058
|
+
<span class='id identifier rubyid_intent'>intent</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='period'>.</span><span class='id identifier rubyid_intent'><span class='object_link'><a href="../Compony.html#intent-class_method" title="Compony.intent (method)">intent</a></span></span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
|
2059
|
+
<span class='id identifier rubyid_sub'>sub</span> <span class='op'>=</span> <span class='id identifier rubyid_intent'>intent</span><span class='period'>.</span><span class='id identifier rubyid_comp'>comp</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='label'>index:</span> <span class='ivar'>@sub_comps</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_comp_opts'>comp_opts</span><span class='rparen'>)</span>
|
|
2324
2060
|
<span class='ivar'>@sub_comps</span> <span class='op'><<</span> <span class='id identifier rubyid_sub'>sub</span>
|
|
2325
2061
|
<span class='kw'>return</span> <span class='id identifier rubyid_sub'>sub</span>
|
|
2326
2062
|
<span class='kw'>end</span></pre>
|
|
@@ -2334,7 +2070,7 @@
|
|
|
2334
2070
|
</div>
|
|
2335
2071
|
|
|
2336
2072
|
<div id="footer">
|
|
2337
|
-
Generated on Thu Nov
|
|
2073
|
+
Generated on Thu Nov 27 16:02:22 2025 by
|
|
2338
2074
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2339
2075
|
0.9.34 (ruby-3.3.5).
|
|
2340
2076
|
</div>
|