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.html
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<dl>
|
|
80
80
|
<dt>Defined in:</dt>
|
|
81
81
|
<dd>lib/compony.rb<span class="defines">,<br />
|
|
82
|
-
lib/compony/engine.rb,<br /> lib/compony/version.rb,<br /> lib/compony/component.rb,<br /> lib/compony/model_mixin.rb,<br /> lib/compony/view_helpers.rb,<br /> lib/compony/virtual_model.rb,<br /> lib/compony/components/new.rb,<br /> lib/compony/components/edit.rb,<br /> lib/compony/components/form.rb,<br /> lib/compony/components/list.rb,<br /> lib/compony/components/show.rb,<br /> lib/compony/request_context.rb,<br /> lib/compony/components/index.rb,<br /> lib/compony/controller_mixin.rb,<br /> lib/compony/model_fields/url.rb,<br /> lib/compony/natural_ordering.rb,<br /> lib/compony/
|
|
82
|
+
lib/compony/engine.rb,<br /> lib/compony/intent.rb,<br /> lib/compony/version.rb,<br /> lib/compony/component.rb,<br /> lib/compony/model_mixin.rb,<br /> lib/compony/view_helpers.rb,<br /> lib/compony/virtual_model.rb,<br /> lib/compony/components/new.rb,<br /> lib/compony/components/edit.rb,<br /> lib/compony/components/form.rb,<br /> lib/compony/components/list.rb,<br /> lib/compony/components/show.rb,<br /> lib/compony/request_context.rb,<br /> lib/compony/components/index.rb,<br /> lib/compony/controller_mixin.rb,<br /> lib/compony/model_fields/url.rb,<br /> lib/compony/natural_ordering.rb,<br /> lib/compony/model_fields/base.rb,<br /> lib/compony/model_fields/date.rb,<br /> lib/compony/model_fields/text.rb,<br /> lib/compony/model_fields/time.rb,<br /> lib/compony/components/destroy.rb,<br /> lib/compony/model_fields/color.rb,<br /> lib/compony/model_fields/email.rb,<br /> lib/compony/model_fields/float.rb,<br /> lib/compony/model_fields/phone.rb,<br /> lib/compony/exposed_intents_dsl.rb,<br /> lib/compony/model_fields/string.rb,<br /> lib/compony/components/with_form.rb,<br /> lib/compony/model_fields/boolean.rb,<br /> lib/compony/model_fields/decimal.rb,<br /> lib/compony/model_fields/integer.rb,<br /> lib/compony/model_fields/currency.rb,<br /> lib/compony/model_fields/datetime.rb,<br /> lib/compony/method_accessible_hash.rb,<br /> lib/compony/model_fields/rich_text.rb,<br /> lib/compony/components/buttons/link.rb,<br /> lib/compony/model_fields/attachment.rb,<br /> lib/compony/model_fields/percentage.rb,<br /> lib/compony/model_fields/anchormodel.rb,<br /> lib/compony/model_fields/association.rb,<br /> lib/compony/component_mixins/resourceful.rb,<br /> lib/compony/components/buttons/css_button.rb,<br /> lib/compony/component_mixins/default/labelling.rb,<br /> lib/compony/component_mixins/default/standalone.rb,<br /> lib/compony/component_mixins/default/standalone/verb_dsl.rb,<br /> lib/compony/component_mixins/default/standalone/standalone_dsl.rb,<br /> lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb</span>
|
|
83
83
|
</dd>
|
|
84
84
|
</dl>
|
|
85
85
|
|
|
@@ -101,6 +101,8 @@
|
|
|
101
101
|
|
|
102
102
|
<li><span class='object_link'><a href="Compony/ViewHelpers.html" title="Compony::ViewHelpers (module)">Compony::ViewHelpers for helpers that require a view context and render results immediately</a></span></li>
|
|
103
103
|
|
|
104
|
+
<li><span class='object_link'><a href="Compony/RequestContext.html" title="Compony::RequestContext (class)">Compony::RequestContext for helpers that require a view context and render results immediately</a></span></li>
|
|
105
|
+
|
|
104
106
|
</ul>
|
|
105
107
|
|
|
106
108
|
</div><h2>Defined Under Namespace</h2>
|
|
@@ -111,7 +113,7 @@
|
|
|
111
113
|
|
|
112
114
|
|
|
113
115
|
|
|
114
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span>, <span class='object_link'><a href="Compony/Engine.html" title="Compony::Engine (class)">Engine</a></span>, <span class='object_link'><a href="Compony/MethodAccessibleHash.html" title="Compony::MethodAccessibleHash (class)">MethodAccessibleHash</a></span>, <span class='object_link'><a href="Compony/NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span>, <span class='object_link'><a href="Compony/RequestContext.html" title="Compony::RequestContext (class)">RequestContext</a></span>, <span class='object_link'><a href="Compony/VirtualModel.html" title="Compony::VirtualModel (class)">VirtualModel</a></span>
|
|
116
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span>, <span class='object_link'><a href="Compony/Engine.html" title="Compony::Engine (class)">Engine</a></span>, <span class='object_link'><a href="Compony/ExposedIntentsDsl.html" title="Compony::ExposedIntentsDsl (class)">ExposedIntentsDsl</a></span>, <span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">Intent</a></span>, <span class='object_link'><a href="Compony/MethodAccessibleHash.html" title="Compony::MethodAccessibleHash (class)">MethodAccessibleHash</a></span>, <span class='object_link'><a href="Compony/NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span>, <span class='object_link'><a href="Compony/RequestContext.html" title="Compony::RequestContext (class)">RequestContext</a></span>, <span class='object_link'><a href="Compony/VirtualModel.html" title="Compony::VirtualModel (class)">VirtualModel</a></span>
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
</p>
|
|
@@ -181,7 +183,7 @@
|
|
|
181
183
|
<li class="public ">
|
|
182
184
|
<span class="summary_signature">
|
|
183
185
|
|
|
184
|
-
<a href="#
|
|
186
|
+
<a href="#button_component_class-class_method" title="button_component_class (class method)">.<strong>button_component_class</strong>(style = default_button_style) ⇒ Object </a>
|
|
185
187
|
|
|
186
188
|
|
|
187
189
|
|
|
@@ -196,7 +198,7 @@
|
|
|
196
198
|
|
|
197
199
|
|
|
198
200
|
<span class="summary_desc"><div class='inline'>
|
|
199
|
-
<p>
|
|
201
|
+
<p>Getter for the button component class for a given style.</p>
|
|
200
202
|
</div></span>
|
|
201
203
|
|
|
202
204
|
</li>
|
|
@@ -205,7 +207,7 @@
|
|
|
205
207
|
<li class="public ">
|
|
206
208
|
<span class="summary_signature">
|
|
207
209
|
|
|
208
|
-
<a href="#
|
|
210
|
+
<a href="#comp_class_for-class_method" title="comp_class_for (class method)">.<strong>comp_class_for</strong> ⇒ Object </a>
|
|
209
211
|
|
|
210
212
|
|
|
211
213
|
|
|
@@ -220,7 +222,7 @@
|
|
|
220
222
|
|
|
221
223
|
|
|
222
224
|
<span class="summary_desc"><div class='inline'>
|
|
223
|
-
<p>
|
|
225
|
+
<p>Given a component and a family/model, this returns the matching component class if any, or nil if the component does not exist.</p>
|
|
224
226
|
</div></span>
|
|
225
227
|
|
|
226
228
|
</li>
|
|
@@ -229,7 +231,7 @@
|
|
|
229
231
|
<li class="public ">
|
|
230
232
|
<span class="summary_signature">
|
|
231
233
|
|
|
232
|
-
<a href="#
|
|
234
|
+
<a href="#comp_class_for!-class_method" title="comp_class_for! (class method)">.<strong>comp_class_for!</strong> ⇒ Object </a>
|
|
233
235
|
|
|
234
236
|
|
|
235
237
|
|
|
@@ -244,7 +246,7 @@
|
|
|
244
246
|
|
|
245
247
|
|
|
246
248
|
<span class="summary_desc"><div class='inline'>
|
|
247
|
-
<p>
|
|
249
|
+
<p>Same as Compony#comp_class_for but fails if none found.</p>
|
|
248
250
|
</div></span>
|
|
249
251
|
|
|
250
252
|
</li>
|
|
@@ -253,7 +255,7 @@
|
|
|
253
255
|
<li class="public ">
|
|
254
256
|
<span class="summary_signature">
|
|
255
257
|
|
|
256
|
-
<a href="#
|
|
258
|
+
<a href="#content_after_root_comp-class_method" title="content_after_root_comp (class method)">.<strong>content_after_root_comp</strong>(&block) ⇒ Object </a>
|
|
257
259
|
|
|
258
260
|
|
|
259
261
|
|
|
@@ -268,7 +270,7 @@
|
|
|
268
270
|
|
|
269
271
|
|
|
270
272
|
<span class="summary_desc"><div class='inline'>
|
|
271
|
-
<p>
|
|
273
|
+
<p>Setter for a content block that runs after the root component gets rendered (standalone only).</p>
|
|
272
274
|
</div></span>
|
|
273
275
|
|
|
274
276
|
</li>
|
|
@@ -277,7 +279,7 @@
|
|
|
277
279
|
<li class="public ">
|
|
278
280
|
<span class="summary_signature">
|
|
279
281
|
|
|
280
|
-
<a href="#
|
|
282
|
+
<a href="#content_after_root_comp_block-class_method" title="content_after_root_comp_block (class method)">.<strong>content_after_root_comp_block</strong> ⇒ Object </a>
|
|
281
283
|
|
|
282
284
|
|
|
283
285
|
|
|
@@ -292,7 +294,7 @@
|
|
|
292
294
|
|
|
293
295
|
|
|
294
296
|
<span class="summary_desc"><div class='inline'>
|
|
295
|
-
<p>
|
|
297
|
+
<p>Getter for content_after_root_comp_block.</p>
|
|
296
298
|
</div></span>
|
|
297
299
|
|
|
298
300
|
</li>
|
|
@@ -301,7 +303,7 @@
|
|
|
301
303
|
<li class="public ">
|
|
302
304
|
<span class="summary_signature">
|
|
303
305
|
|
|
304
|
-
<a href="#
|
|
306
|
+
<a href="#content_before_root_comp-class_method" title="content_before_root_comp (class method)">.<strong>content_before_root_comp</strong>(&block) ⇒ Object </a>
|
|
305
307
|
|
|
306
308
|
|
|
307
309
|
|
|
@@ -316,7 +318,7 @@
|
|
|
316
318
|
|
|
317
319
|
|
|
318
320
|
<span class="summary_desc"><div class='inline'>
|
|
319
|
-
<p>
|
|
321
|
+
<p>Setter for a content block that runs before the root component gets rendered (standalone only).</p>
|
|
320
322
|
</div></span>
|
|
321
323
|
|
|
322
324
|
</li>
|
|
@@ -325,7 +327,7 @@
|
|
|
325
327
|
<li class="public ">
|
|
326
328
|
<span class="summary_signature">
|
|
327
329
|
|
|
328
|
-
<a href="#
|
|
330
|
+
<a href="#content_before_root_comp_block-class_method" title="content_before_root_comp_block (class method)">.<strong>content_before_root_comp_block</strong> ⇒ Object </a>
|
|
329
331
|
|
|
330
332
|
|
|
331
333
|
|
|
@@ -340,7 +342,7 @@
|
|
|
340
342
|
|
|
341
343
|
|
|
342
344
|
<span class="summary_desc"><div class='inline'>
|
|
343
|
-
<p>
|
|
345
|
+
<p>Getter for content_before_root_comp_block.</p>
|
|
344
346
|
</div></span>
|
|
345
347
|
|
|
346
348
|
</li>
|
|
@@ -349,7 +351,7 @@
|
|
|
349
351
|
<li class="public ">
|
|
350
352
|
<span class="summary_signature">
|
|
351
353
|
|
|
352
|
-
<a href="#
|
|
354
|
+
<a href="#default_button_style-class_method" title="default_button_style (class method)">.<strong>default_button_style</strong> ⇒ Object </a>
|
|
353
355
|
|
|
354
356
|
|
|
355
357
|
|
|
@@ -364,7 +366,7 @@
|
|
|
364
366
|
|
|
365
367
|
|
|
366
368
|
<span class="summary_desc"><div class='inline'>
|
|
367
|
-
<p>Getter for
|
|
369
|
+
<p>Getter for the default button style, defaults to <code>:css_button</code>.</p>
|
|
368
370
|
</div></span>
|
|
369
371
|
|
|
370
372
|
</li>
|
|
@@ -373,7 +375,7 @@
|
|
|
373
375
|
<li class="public ">
|
|
374
376
|
<span class="summary_signature">
|
|
375
377
|
|
|
376
|
-
<a href="#
|
|
378
|
+
<a href="#default_button_style=-class_method" title="default_button_style= (class method)">.<strong>default_button_style=</strong>(default_button_style) ⇒ Object </a>
|
|
377
379
|
|
|
378
380
|
|
|
379
381
|
|
|
@@ -388,7 +390,7 @@
|
|
|
388
390
|
|
|
389
391
|
|
|
390
392
|
<span class="summary_desc"><div class='inline'>
|
|
391
|
-
<p>Setter for
|
|
393
|
+
<p>Setter for the default button style.</p>
|
|
392
394
|
</div></span>
|
|
393
395
|
|
|
394
396
|
</li>
|
|
@@ -397,7 +399,7 @@
|
|
|
397
399
|
<li class="public ">
|
|
398
400
|
<span class="summary_signature">
|
|
399
401
|
|
|
400
|
-
<a href="#
|
|
402
|
+
<a href="#family_name_for-class_method" title="family_name_for (class method)">.<strong>family_name_for</strong>(model_or_family_name_or_cst) ⇒ Object </a>
|
|
401
403
|
|
|
402
404
|
|
|
403
405
|
|
|
@@ -412,7 +414,7 @@
|
|
|
412
414
|
|
|
413
415
|
|
|
414
416
|
<span class="summary_desc"><div class='inline'>
|
|
415
|
-
<p>
|
|
417
|
+
<p>Given a family name or a model-like class, this returns the suitable family name as String.</p>
|
|
416
418
|
</div></span>
|
|
417
419
|
|
|
418
420
|
</li>
|
|
@@ -421,7 +423,7 @@
|
|
|
421
423
|
<li class="public ">
|
|
422
424
|
<span class="summary_signature">
|
|
423
425
|
|
|
424
|
-
<a href="#
|
|
426
|
+
<a href="#intent-class_method" title="intent (class method)">.<strong>intent</strong>(intent_or_comp_args) ⇒ Object </a>
|
|
425
427
|
|
|
426
428
|
|
|
427
429
|
|
|
@@ -436,7 +438,7 @@
|
|
|
436
438
|
|
|
437
439
|
|
|
438
440
|
<span class="summary_desc"><div class='inline'>
|
|
439
|
-
<p>
|
|
441
|
+
<p>Pure helper to create a Compony Intent.</p>
|
|
440
442
|
</div></span>
|
|
441
443
|
|
|
442
444
|
</li>
|
|
@@ -517,7 +519,7 @@
|
|
|
517
519
|
<li class="public ">
|
|
518
520
|
<span class="summary_signature">
|
|
519
521
|
|
|
520
|
-
<a href="#path-class_method" title="path (class method)">.<strong>path</strong>(comp_name_or_cst_or_class, model_or_family_name_or_cst = nil
|
|
522
|
+
<a href="#path-class_method" title="path (class method)">.<strong>path</strong>(comp_name_or_cst_or_class, model_or_family_name_or_cst = nil) ⇒ Object </a>
|
|
521
523
|
|
|
522
524
|
|
|
523
525
|
|
|
@@ -541,31 +543,7 @@
|
|
|
541
543
|
<li class="public ">
|
|
542
544
|
<span class="summary_signature">
|
|
543
545
|
|
|
544
|
-
<a href="#
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
</span>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
<span class="summary_desc"><div class='inline'>
|
|
559
|
-
<p>Given a component and a family, this returns the name of the Rails URL helper returning the path to this component.<br> The parameters are the same as for <span class='object_link'><a href="#rails_action_name-class_method" title="Compony.rails_action_name (method)">Compony.rails_action_name</a></span>.<br> Example usage: <code>send("#{path_helper_name(:index, :users)}_url)</code>.</p>
|
|
560
|
-
</div></span>
|
|
561
|
-
|
|
562
|
-
</li>
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
<li class="public ">
|
|
566
|
-
<span class="summary_signature">
|
|
567
|
-
|
|
568
|
-
<a href="#rails_action_name-class_method" title="rails_action_name (class method)">.<strong>rails_action_name</strong>(comp_name_or_cst_or_class, model_or_family_name_or_cst, name = nil) ⇒ Object </a>
|
|
546
|
+
<a href="#register_button_style-class_method" title="register_button_style (class method)">.<strong>register_button_style</strong>(name, button_component_class_name) ⇒ Object </a>
|
|
569
547
|
|
|
570
548
|
|
|
571
549
|
|
|
@@ -580,7 +558,7 @@
|
|
|
580
558
|
|
|
581
559
|
|
|
582
560
|
<span class="summary_desc"><div class='inline'>
|
|
583
|
-
<p>
|
|
561
|
+
<p>Adds a button style that can be referred to when rendering an intent.</p>
|
|
584
562
|
</div></span>
|
|
585
563
|
|
|
586
564
|
</li>
|
|
@@ -607,30 +585,6 @@
|
|
|
607
585
|
<p>Returns the current root component, if any.</p>
|
|
608
586
|
</div></span>
|
|
609
587
|
|
|
610
|
-
</li>
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
<li class="public ">
|
|
614
|
-
<span class="summary_signature">
|
|
615
|
-
|
|
616
|
-
<a href="#with_button_defaults-class_method" title="with_button_defaults (class method)">.<strong>with_button_defaults</strong>(**keys_to_overwrite, &block) ⇒ Object </a>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
</span>
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
<span class="summary_desc"><div class='inline'>
|
|
631
|
-
<p>Overwrites the keys of the current button defaults by the ones provided during the execution of a given block and restores them afterwords.</p>
|
|
632
|
-
</div></span>
|
|
633
|
-
|
|
634
588
|
</li>
|
|
635
589
|
|
|
636
590
|
|
|
@@ -676,12 +630,12 @@
|
|
|
676
630
|
<pre class="lines">
|
|
677
631
|
|
|
678
632
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
633
|
+
104
|
|
634
|
+
105
|
|
635
|
+
106</pre>
|
|
682
636
|
</td>
|
|
683
637
|
<td>
|
|
684
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
638
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 104</span>
|
|
685
639
|
|
|
686
640
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_authentication_before_action'>authentication_before_action</span>
|
|
687
641
|
<span class='ivar'>@authentication_before_action</span>
|
|
@@ -737,12 +691,12 @@
|
|
|
737
691
|
<pre class="lines">
|
|
738
692
|
|
|
739
693
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
694
|
+
47
|
|
695
|
+
48
|
|
696
|
+
49</pre>
|
|
743
697
|
</td>
|
|
744
698
|
<td>
|
|
745
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
699
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 47</span>
|
|
746
700
|
|
|
747
701
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_authentication_before_action='>authentication_before_action=</span><span class='lparen'>(</span><span class='id identifier rubyid_authentication_before_action'>authentication_before_action</span><span class='rparen'>)</span>
|
|
748
702
|
<span class='ivar'>@authentication_before_action</span> <span class='op'>=</span> <span class='id identifier rubyid_authentication_before_action'>authentication_before_action</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
@@ -753,9 +707,9 @@
|
|
|
753
707
|
</div>
|
|
754
708
|
|
|
755
709
|
<div class="method_details ">
|
|
756
|
-
<h3 class="signature " id="
|
|
710
|
+
<h3 class="signature " id="button_component_class-class_method">
|
|
757
711
|
|
|
758
|
-
.<strong>
|
|
712
|
+
.<strong>button_component_class</strong>(style = default_button_style) ⇒ <tt>Object</tt>
|
|
759
713
|
|
|
760
714
|
|
|
761
715
|
|
|
@@ -764,7 +718,7 @@
|
|
|
764
718
|
</h3><div class="docstring">
|
|
765
719
|
<div class="discussion">
|
|
766
720
|
|
|
767
|
-
<p>
|
|
721
|
+
<p>Getter for the button component class for a given style.</p>
|
|
768
722
|
|
|
769
723
|
|
|
770
724
|
</div>
|
|
@@ -775,140 +729,18 @@
|
|
|
775
729
|
|
|
776
730
|
<li>
|
|
777
731
|
|
|
778
|
-
<span class='name'>
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>Class</tt>)</span>
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
—
|
|
786
|
-
<div class='inline'>
|
|
787
|
-
<p>The component that should be loaded, for instance <code>ShowForAll</code>, <code>'ShowForAll'</code> or <code>:show_for_all</code></p>
|
|
788
|
-
</div>
|
|
789
|
-
|
|
790
|
-
</li>
|
|
791
|
-
|
|
792
|
-
<li>
|
|
793
|
-
|
|
794
|
-
<span class='name'>model_or_family_name_or_cst</span>
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>ApplicationRecord</tt>)</span>
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
—
|
|
804
|
-
<div class='inline'>
|
|
805
|
-
<p>Either the family that contains the requested component, or an instance implementing <code>model_name</code> from which the family name is auto-generated. Examples: <code>Users</code>, <code>'Users'</code>, <code>:users</code>, <code>User.first</code></p>
|
|
806
|
-
</div>
|
|
807
|
-
|
|
808
|
-
</li>
|
|
809
|
-
|
|
810
|
-
<li>
|
|
811
|
-
|
|
812
|
-
<span class='name'>label_opts</span>
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
—
|
|
822
|
-
<div class='inline'>
|
|
823
|
-
<p>Options hash that will be passed to the label method (see <span class='object_link'><a href="Compony/ComponentMixins/Default/Labelling.html#label-instance_method" title="Compony::ComponentMixins::Default::Labelling#label (method)">Compony::ComponentMixins::Default::Labelling#label</a></span>)</p>
|
|
824
|
-
</div>
|
|
825
|
-
|
|
826
|
-
</li>
|
|
827
|
-
|
|
828
|
-
<li>
|
|
829
|
-
|
|
830
|
-
<span class='name'>params</span>
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
—
|
|
840
|
-
<div class='inline'>
|
|
841
|
-
<p>GET parameters to be inclued into the path this button points to. Special case: e.g. format: :pdf -> some.url/foo/bar.pdf</p>
|
|
842
|
-
</div>
|
|
843
|
-
|
|
844
|
-
</li>
|
|
845
|
-
|
|
846
|
-
<li>
|
|
847
|
-
|
|
848
|
-
<span class='name'>feasibility_action</span>
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
—
|
|
858
|
-
<div class='inline'>
|
|
859
|
-
<p>Name of the feasibility action that should be checked for this button, defaults to the component name</p>
|
|
860
|
-
</div>
|
|
861
|
-
|
|
862
|
-
</li>
|
|
863
|
-
|
|
864
|
-
<li>
|
|
865
|
-
|
|
866
|
-
<span class='name'>feasibility_target</span>
|
|
732
|
+
<span class='name'>style</span>
|
|
867
733
|
|
|
868
734
|
|
|
869
735
|
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
870
736
|
|
|
871
737
|
|
|
872
|
-
<em class="default">(defaults to: <tt>
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
—
|
|
876
|
-
<div class='inline'>
|
|
877
|
-
<p>Name of the feasibility target (subject) that the feasibility should be checked on, defaults to the model if given</p>
|
|
878
|
-
</div>
|
|
879
|
-
|
|
880
|
-
</li>
|
|
881
|
-
|
|
882
|
-
<li>
|
|
883
|
-
|
|
884
|
-
<span class='name'>standalone_name</span>
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
<span class='type'>(<tt>Symbol</tt>, <tt>nil</tt>)</span>
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
738
|
+
<em class="default">(defaults to: <tt>default_button_style</tt>)</em>
|
|
891
739
|
|
|
892
740
|
|
|
893
741
|
—
|
|
894
742
|
<div class='inline'>
|
|
895
|
-
<p>
|
|
896
|
-
</div>
|
|
897
|
-
|
|
898
|
-
</li>
|
|
899
|
-
|
|
900
|
-
<li>
|
|
901
|
-
|
|
902
|
-
<span class='name'>override_kwargs</span>
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
—
|
|
910
|
-
<div class='inline'>
|
|
911
|
-
<p>Override button options, see options for <span class='object_link'><a href="Compony/Components/Button.html" title="Compony::Components::Button (class)">Compony::Components::Button</a></span></p>
|
|
743
|
+
<p>Style for which the matching button component class should be returned. Defaults to <span class='object_link'><a href="#default_button_style-class_method" title="Compony.default_button_style (method)">default_button_style</a></span>.</p>
|
|
912
744
|
</div>
|
|
913
745
|
|
|
914
746
|
</li>
|
|
@@ -919,9 +751,9 @@
|
|
|
919
751
|
<p class="tag_title">See Also:</p>
|
|
920
752
|
<ul class="see">
|
|
921
753
|
|
|
922
|
-
<li
|
|
754
|
+
<li>{Compony{Compony#register_button_style}</li>
|
|
923
755
|
|
|
924
|
-
<li
|
|
756
|
+
<li>{Compony{Compony#default_button_style}</li>
|
|
925
757
|
|
|
926
758
|
</ul>
|
|
927
759
|
|
|
@@ -931,81 +763,41 @@
|
|
|
931
763
|
<pre class="lines">
|
|
932
764
|
|
|
933
765
|
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
193
|
|
951
|
-
194
|
|
952
|
-
195
|
|
953
|
-
196
|
|
954
|
-
197
|
|
955
|
-
198
|
|
956
|
-
199
|
|
957
|
-
200
|
|
958
|
-
201
|
|
959
|
-
202
|
|
960
|
-
203
|
|
961
|
-
204
|
|
962
|
-
205
|
|
963
|
-
206
|
|
964
|
-
207
|
|
965
|
-
208
|
|
966
|
-
209
|
|
967
|
-
210
|
|
968
|
-
211
|
|
969
|
-
212</pre>
|
|
766
|
+
73
|
|
767
|
+
74
|
|
768
|
+
75
|
|
769
|
+
76
|
|
770
|
+
77
|
|
771
|
+
78
|
|
772
|
+
79
|
|
773
|
+
80
|
|
774
|
+
81
|
|
775
|
+
82
|
|
776
|
+
83
|
|
777
|
+
84
|
|
778
|
+
85
|
|
779
|
+
86
|
|
780
|
+
87
|
|
781
|
+
88</pre>
|
|
970
782
|
</td>
|
|
971
783
|
<td>
|
|
972
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
973
|
-
|
|
974
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span> <span class='op'><=</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span></span><span class='rparen'>)</span>
|
|
987
|
-
<span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span> <span class='op'>=</span> <span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
|
|
988
|
-
<span class='kw'>else</span>
|
|
989
|
-
<span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for!'><span class='object_link'><a href="#comp_class_for!-class_method" title="Compony.comp_class_for! (method)">comp_class_for!</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
|
|
990
|
-
<span class='kw'>end</span>
|
|
991
|
-
<span class='id identifier rubyid_feasibility_action'>feasibility_action</span> <span class='op'>||=</span> <span class='id identifier rubyid_button_defaults'>button_defaults</span><span class='lbracket'>[</span><span class='symbol'>:feasibility_action</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
992
|
-
<span class='id identifier rubyid_feasibility_target'>feasibility_target</span> <span class='op'>||=</span> <span class='id identifier rubyid_button_defaults'>button_defaults</span><span class='lbracket'>[</span><span class='symbol'>:feasibility_target</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_model'>model</span>
|
|
993
|
-
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
|
994
|
-
<span class='label'>label:</span> <span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_label_opts'>label_opts</span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
995
|
-
<span class='label'>icon:</span> <span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_icon'>icon</span><span class='comma'>,</span>
|
|
996
|
-
<span class='label'>color:</span> <span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='comma'>,</span>
|
|
997
|
-
<span class='label'>path:</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_path'><span class='object_link'><a href="#path-class_method" title="Compony.path (method)">path</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='comma'>,</span> <span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_family_name'>family_name</span><span class='comma'>,</span> <span class='id identifier rubyid_model'>model</span><span class='comma'>,</span> <span class='label'>standalone_name:</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
998
|
-
<span class='label'>method:</span><span class='comma'>,</span>
|
|
999
|
-
<span class='label'>visible:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_target_comp_instance'>target_comp_instance</span><span class='period'>.</span><span class='id identifier rubyid_standalone_access_permitted_for?'>standalone_access_permitted_for?</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='comma'>,</span> <span class='label'>standalone_name:</span><span class='comma'>,</span> <span class='label'>verb:</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
1000
|
-
<span class='rbrace'>}</span>
|
|
1001
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_feasibility_target'>feasibility_target</span>
|
|
1002
|
-
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
|
1003
|
-
<span class='label'>enabled:</span> <span class='id identifier rubyid_feasibility_target'>feasibility_target</span><span class='period'>.</span><span class='id identifier rubyid_feasible?'>feasible?</span><span class='lparen'>(</span><span class='id identifier rubyid_feasibility_action'>feasibility_action</span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
1004
|
-
<span class='label'>title:</span> <span class='id identifier rubyid_feasibility_target'>feasibility_target</span><span class='period'>.</span><span class='id identifier rubyid_full_feasibility_messages'>full_feasibility_messages</span><span class='lparen'>(</span><span class='id identifier rubyid_feasibility_action'>feasibility_action</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span>
|
|
1005
|
-
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
784
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 73</span>
|
|
785
|
+
|
|
786
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_button_component_class'>button_component_class</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='id identifier rubyid_default_button_style'>default_button_style</span><span class='rparen'>)</span>
|
|
787
|
+
<span class='comment'># Lazy initialize
|
|
788
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@button_component_classes</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
789
|
+
<span class='ivar'>@button_component_classes</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
|
790
|
+
<span class='label'>css_button:</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components.html" title="Compony::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Buttons.html" title="Compony::Components::Buttons (module)">Buttons</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Buttons/CssButton.html" title="Compony::Components::Buttons::CssButton (class)">CssButton</a></span></span><span class='comma'>,</span>
|
|
791
|
+
<span class='label'>link:</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components.html" title="Compony::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Buttons.html" title="Compony::Components::Buttons (module)">Buttons</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Components/Buttons/Link.html" title="Compony::Components::Buttons::Link (class)">Link</a></span></span>
|
|
792
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@button_component_class_names</span><span class='op'>&.</span><span class='id identifier rubyid_transform_values'>transform_values</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:constantize</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
793
|
+
<span class='ivar'>@button_component_classes</span><span class='period'>.</span><span class='id identifier rubyid_each_value'>each_value</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_button_component_class'>button_component_class</span><span class='op'>|</span>
|
|
794
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_button_component_class'>button_component_class</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_button_component_class'>button_component_class</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span></span>
|
|
795
|
+
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Expected a button component class, got </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_button_component_class'>button_component_class</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
796
|
+
<span class='kw'>end</span>
|
|
797
|
+
<span class='kw'>end</span>
|
|
1006
798
|
<span class='kw'>end</span>
|
|
1007
|
-
<span class='
|
|
1008
|
-
<span class='kw'>return</span> <span class='
|
|
799
|
+
<span class='comment'># Retrieval
|
|
800
|
+
</span> <span class='kw'>return</span> <span class='ivar'>@button_component_classes</span><span class='lbracket'>[</span><span class='id identifier rubyid_style'>style</span><span class='op'>&.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</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'>Unknown button style </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>. Use one of: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@button_component_classes</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
1009
801
|
<span class='kw'>end</span></pre>
|
|
1010
802
|
</td>
|
|
1011
803
|
</tr>
|
|
@@ -1013,9 +805,9 @@
|
|
|
1013
805
|
</div>
|
|
1014
806
|
|
|
1015
807
|
<div class="method_details ">
|
|
1016
|
-
<h3 class="signature " id="
|
|
808
|
+
<h3 class="signature " id="comp_class_for-class_method">
|
|
1017
809
|
|
|
1018
|
-
.<strong>
|
|
810
|
+
.<strong>comp_class_for</strong> ⇒ <tt>Object</tt>
|
|
1019
811
|
|
|
1020
812
|
|
|
1021
813
|
|
|
@@ -1024,7 +816,7 @@
|
|
|
1024
816
|
</h3><div class="docstring">
|
|
1025
817
|
<div class="discussion">
|
|
1026
818
|
|
|
1027
|
-
<p>
|
|
819
|
+
<p>Given a component and a family/model, this returns the matching component class if any, or nil if the component does not exist.</p>
|
|
1028
820
|
|
|
1029
821
|
|
|
1030
822
|
</div>
|
|
@@ -1035,7 +827,7 @@
|
|
|
1035
827
|
<p class="tag_title">See Also:</p>
|
|
1036
828
|
<ul class="see">
|
|
1037
829
|
|
|
1038
|
-
<li><span class='object_link'><a href="
|
|
830
|
+
<li><span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">for allowed parameters.</a></span></li>
|
|
1039
831
|
|
|
1040
832
|
</ul>
|
|
1041
833
|
|
|
@@ -1045,19 +837,19 @@
|
|
|
1045
837
|
<pre class="lines">
|
|
1046
838
|
|
|
1047
839
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
840
|
+
141
|
|
841
|
+
142
|
|
842
|
+
143
|
|
843
|
+
144
|
|
844
|
+
145</pre>
|
|
1053
845
|
</td>
|
|
1054
846
|
<td>
|
|
1055
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
847
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 141</span>
|
|
1056
848
|
|
|
1057
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1058
|
-
<span class='
|
|
1059
|
-
|
|
1060
|
-
<span class='kw'>return</span> <span class='
|
|
849
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for'>comp_class_for</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
|
|
850
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_intent'>intent</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_comp_class'>comp_class</span>
|
|
851
|
+
<span class='kw'>rescue</span> <span class='const'>NameError</span>
|
|
852
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
|
1061
853
|
<span class='kw'>end</span></pre>
|
|
1062
854
|
</td>
|
|
1063
855
|
</tr>
|
|
@@ -1065,9 +857,9 @@
|
|
|
1065
857
|
</div>
|
|
1066
858
|
|
|
1067
859
|
<div class="method_details ">
|
|
1068
|
-
<h3 class="signature " id="
|
|
860
|
+
<h3 class="signature " id="comp_class_for!-class_method">
|
|
1069
861
|
|
|
1070
|
-
.<strong>
|
|
862
|
+
.<strong>comp_class_for!</strong> ⇒ <tt>Object</tt>
|
|
1071
863
|
|
|
1072
864
|
|
|
1073
865
|
|
|
@@ -1076,33 +868,22 @@
|
|
|
1076
868
|
</h3><div class="docstring">
|
|
1077
869
|
<div class="discussion">
|
|
1078
870
|
|
|
1079
|
-
<p>
|
|
871
|
+
<p>Same as Compony#comp_class_for but fails if none found</p>
|
|
1080
872
|
|
|
1081
873
|
|
|
1082
874
|
</div>
|
|
1083
875
|
</div>
|
|
1084
876
|
<div class="tags">
|
|
1085
|
-
<p class="tag_title">Parameters:</p>
|
|
1086
|
-
<ul class="param">
|
|
1087
|
-
|
|
1088
|
-
<li>
|
|
1089
|
-
|
|
1090
|
-
<span class='name'>button_component_class</span>
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
<span class='type'>(<tt>String</tt>)</span>
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
—
|
|
1098
|
-
<div class='inline'>
|
|
1099
|
-
<p>Name of your custom button component class (inherit from <span class='object_link'><a href="Compony/Components/Button.html" title="Compony::Components::Button (class)">Compony::Components::Button</a></span> or <span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span>)</p>
|
|
1100
|
-
</div>
|
|
1101
|
-
|
|
1102
|
-
</li>
|
|
1103
877
|
|
|
1104
|
-
</ul>
|
|
1105
878
|
|
|
879
|
+
<p class="tag_title">See Also:</p>
|
|
880
|
+
<ul class="see">
|
|
881
|
+
|
|
882
|
+
<li><span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">for allowed parameters.</a></span></li>
|
|
883
|
+
|
|
884
|
+
<li><span class='object_link'><a href="#comp_class_for-class_method" title="Compony.comp_class_for (method)">comp_class_for</a></span></li>
|
|
885
|
+
|
|
886
|
+
</ul>
|
|
1106
887
|
|
|
1107
888
|
</div><table class="source_code">
|
|
1108
889
|
<tr>
|
|
@@ -1110,15 +891,19 @@
|
|
|
1110
891
|
<pre class="lines">
|
|
1111
892
|
|
|
1112
893
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
894
|
+
150
|
|
895
|
+
151
|
|
896
|
+
152
|
|
897
|
+
153
|
|
898
|
+
154</pre>
|
|
1116
899
|
</td>
|
|
1117
900
|
<td>
|
|
1118
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
901
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 150</span>
|
|
1119
902
|
|
|
1120
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1121
|
-
<span class='
|
|
903
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for!'>comp_class_for!</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
|
|
904
|
+
<span class='id identifier rubyid_comp_class_for'>comp_class_for</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span>
|
|
905
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No component found for [</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_comp_name_or_cst'>comp_name_or_cst</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='period'>.</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>
|
|
906
|
+
<span class='rparen'>)</span>
|
|
1122
907
|
<span class='kw'>end</span></pre>
|
|
1123
908
|
</td>
|
|
1124
909
|
</tr>
|
|
@@ -1126,9 +911,9 @@
|
|
|
1126
911
|
</div>
|
|
1127
912
|
|
|
1128
913
|
<div class="method_details ">
|
|
1129
|
-
<h3 class="signature " id="
|
|
914
|
+
<h3 class="signature " id="content_after_root_comp-class_method">
|
|
1130
915
|
|
|
1131
|
-
.<strong>
|
|
916
|
+
.<strong>content_after_root_comp</strong>(&block) ⇒ <tt>Object</tt>
|
|
1132
917
|
|
|
1133
918
|
|
|
1134
919
|
|
|
@@ -1137,15 +922,7 @@
|
|
|
1137
922
|
</h3><div class="docstring">
|
|
1138
923
|
<div class="discussion">
|
|
1139
924
|
|
|
1140
|
-
|
|
1141
|
-
<strong>TODO:</strong>
|
|
1142
|
-
<div class='inline'>
|
|
1143
|
-
<p>document params</p>
|
|
1144
|
-
</div>
|
|
1145
|
-
</div>
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
<p>Getter for current button defaults</p>
|
|
925
|
+
<p>Setter for a content block that runs after the root component gets rendered (standalone only). Usage is the same as <code>content</code>. The block runs after <code>render</code>, i.e. after the last <code>content</code> block.</p>
|
|
1149
926
|
|
|
1150
927
|
|
|
1151
928
|
</div>
|
|
@@ -1159,15 +936,17 @@
|
|
|
1159
936
|
<pre class="lines">
|
|
1160
937
|
|
|
1161
938
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
939
|
+
60
|
|
940
|
+
61
|
|
941
|
+
62
|
|
942
|
+
63</pre>
|
|
1165
943
|
</td>
|
|
1166
944
|
<td>
|
|
1167
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
945
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 60</span>
|
|
1168
946
|
|
|
1169
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1170
|
-
<span class='
|
|
947
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_after_root_comp'>content_after_root_comp</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
948
|
+
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>`Compony.content_after` requires a block.</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>
|
|
949
|
+
<span class='ivar'>@content_after_root_comp_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
1171
950
|
<span class='kw'>end</span></pre>
|
|
1172
951
|
</td>
|
|
1173
952
|
</tr>
|
|
@@ -1175,9 +954,9 @@
|
|
|
1175
954
|
</div>
|
|
1176
955
|
|
|
1177
956
|
<div class="method_details ">
|
|
1178
|
-
<h3 class="signature " id="
|
|
957
|
+
<h3 class="signature " id="content_after_root_comp_block-class_method">
|
|
1179
958
|
|
|
1180
|
-
.<strong>
|
|
959
|
+
.<strong>content_after_root_comp_block</strong> ⇒ <tt>Object</tt>
|
|
1181
960
|
|
|
1182
961
|
|
|
1183
962
|
|
|
@@ -1186,94 +965,7 @@
|
|
|
1186
965
|
</h3><div class="docstring">
|
|
1187
966
|
<div class="discussion">
|
|
1188
967
|
|
|
1189
|
-
<p>
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
</div>
|
|
1193
|
-
</div>
|
|
1194
|
-
<div class="tags">
|
|
1195
|
-
<p class="tag_title">Parameters:</p>
|
|
1196
|
-
<ul class="param">
|
|
1197
|
-
|
|
1198
|
-
<li>
|
|
1199
|
-
|
|
1200
|
-
<span class='name'>comp_name_or_cst</span>
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
—
|
|
1208
|
-
<div class='inline'>
|
|
1209
|
-
<p>The component that should be loaded, for instance <code>ShowForAll</code>, <code>'ShowForAll'</code> or <code>:show_for_all</code></p>
|
|
1210
|
-
</div>
|
|
1211
|
-
|
|
1212
|
-
</li>
|
|
1213
|
-
|
|
1214
|
-
<li>
|
|
1215
|
-
|
|
1216
|
-
<span class='name'>model_or_family_name_or_cst</span>
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>ApplicationRecord</tt>)</span>
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
—
|
|
1224
|
-
<div class='inline'>
|
|
1225
|
-
<p>Either the family that contains the requested component, or an instance implementing <code>model_name</code> from which the family name is auto-generated. Examples: <code>Users</code>, <code>'Users'</code>, <code>:users</code>, <code>User.first</code></p>
|
|
1226
|
-
</div>
|
|
1227
|
-
|
|
1228
|
-
</li>
|
|
1229
|
-
|
|
1230
|
-
</ul>
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
</div><table class="source_code">
|
|
1234
|
-
<tr>
|
|
1235
|
-
<td>
|
|
1236
|
-
<pre class="lines">
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
123
|
|
1240
|
-
124
|
|
1241
|
-
125
|
|
1242
|
-
126
|
|
1243
|
-
127
|
|
1244
|
-
128
|
|
1245
|
-
129
|
|
1246
|
-
130</pre>
|
|
1247
|
-
</td>
|
|
1248
|
-
<td>
|
|
1249
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 123</span>
|
|
1250
|
-
|
|
1251
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for'>comp_class_for</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst'>comp_name_or_cst</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span>
|
|
1252
|
-
<span class='id identifier rubyid_family_cst_str'>family_cst_str</span> <span class='op'>=</span> <span class='id identifier rubyid_family_name_for'>family_name_for</span><span class='lparen'>(</span><span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span>
|
|
1253
|
-
<span class='id identifier rubyid_comp_cst_str'>comp_cst_str</span> <span class='op'>=</span> <span class='id identifier rubyid_comp_name_or_cst'>comp_name_or_cst</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span>
|
|
1254
|
-
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="Components.html" title="Components (module)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_family_cst_str'>family_cst_str</span><span class='rparen'>)</span>
|
|
1255
|
-
<span class='id identifier rubyid_family_constant'>family_constant</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="Components.html" title="Components (module)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_family_cst_str'>family_cst_str</span><span class='rparen'>)</span>
|
|
1256
|
-
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_family_constant'>family_constant</span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_cst_str'>comp_cst_str</span><span class='rparen'>)</span>
|
|
1257
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_family_constant'>family_constant</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_cst_str'>comp_cst_str</span><span class='rparen'>)</span>
|
|
1258
|
-
<span class='kw'>end</span></pre>
|
|
1259
|
-
</td>
|
|
1260
|
-
</tr>
|
|
1261
|
-
</table>
|
|
1262
|
-
</div>
|
|
1263
|
-
|
|
1264
|
-
<div class="method_details ">
|
|
1265
|
-
<h3 class="signature " id="comp_class_for!-class_method">
|
|
1266
|
-
|
|
1267
|
-
.<strong>comp_class_for!</strong>(comp_name_or_cst, model_or_family_name_or_cst) ⇒ <tt>Object</tt>
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
</h3><div class="docstring">
|
|
1274
|
-
<div class="discussion">
|
|
1275
|
-
|
|
1276
|
-
<p>Same as Compony#comp_class_for but fails if none found</p>
|
|
968
|
+
<p>Getter for content_after_root_comp_block</p>
|
|
1277
969
|
|
|
1278
970
|
|
|
1279
971
|
</div>
|
|
@@ -1284,7 +976,7 @@
|
|
|
1284
976
|
<p class="tag_title">See Also:</p>
|
|
1285
977
|
<ul class="see">
|
|
1286
978
|
|
|
1287
|
-
<li
|
|
979
|
+
<li>#content_after_root_comp=</li>
|
|
1288
980
|
|
|
1289
981
|
</ul>
|
|
1290
982
|
|
|
@@ -1294,19 +986,15 @@
|
|
|
1294
986
|
<pre class="lines">
|
|
1295
987
|
|
|
1296
988
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
137
|
|
1301
|
-
138</pre>
|
|
989
|
+
116
|
|
990
|
+
117
|
|
991
|
+
118</pre>
|
|
1302
992
|
</td>
|
|
1303
993
|
<td>
|
|
1304
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
994
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 116</span>
|
|
1305
995
|
|
|
1306
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1307
|
-
<span class='
|
|
1308
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No component found for [</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_comp_name_or_cst'>comp_name_or_cst</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='period'>.</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>
|
|
1309
|
-
<span class='rparen'>)</span>
|
|
996
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_after_root_comp_block'>content_after_root_comp_block</span>
|
|
997
|
+
<span class='ivar'>@content_after_root_comp_block</span>
|
|
1310
998
|
<span class='kw'>end</span></pre>
|
|
1311
999
|
</td>
|
|
1312
1000
|
</tr>
|
|
@@ -1314,9 +1002,9 @@
|
|
|
1314
1002
|
</div>
|
|
1315
1003
|
|
|
1316
1004
|
<div class="method_details ">
|
|
1317
|
-
<h3 class="signature " id="
|
|
1005
|
+
<h3 class="signature " id="content_before_root_comp-class_method">
|
|
1318
1006
|
|
|
1319
|
-
.<strong>
|
|
1007
|
+
.<strong>content_before_root_comp</strong>(&block) ⇒ <tt>Object</tt>
|
|
1320
1008
|
|
|
1321
1009
|
|
|
1322
1010
|
|
|
@@ -1325,7 +1013,7 @@
|
|
|
1325
1013
|
</h3><div class="docstring">
|
|
1326
1014
|
<div class="discussion">
|
|
1327
1015
|
|
|
1328
|
-
<p>Setter for a content block that runs
|
|
1016
|
+
<p>Setter for a content block that runs before the root component gets rendered (standalone only). Usage is the same as <code>content</code>. The block runs between <code>before_render</code> and <code>render</code>, i.e. before the first <code>content</code> block.</p>
|
|
1329
1017
|
|
|
1330
1018
|
|
|
1331
1019
|
</div>
|
|
@@ -1339,17 +1027,17 @@
|
|
|
1339
1027
|
<pre class="lines">
|
|
1340
1028
|
|
|
1341
1029
|
|
|
1342
|
-
52
|
|
1343
1030
|
53
|
|
1344
1031
|
54
|
|
1345
|
-
55
|
|
1032
|
+
55
|
|
1033
|
+
56</pre>
|
|
1346
1034
|
</td>
|
|
1347
1035
|
<td>
|
|
1348
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1036
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 53</span>
|
|
1349
1037
|
|
|
1350
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1351
|
-
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>`Compony.
|
|
1352
|
-
<span class='ivar'>@
|
|
1038
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_before_root_comp'>content_before_root_comp</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1039
|
+
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>`Compony.content_before` requires a block.</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>
|
|
1040
|
+
<span class='ivar'>@content_before_root_comp_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
1353
1041
|
<span class='kw'>end</span></pre>
|
|
1354
1042
|
</td>
|
|
1355
1043
|
</tr>
|
|
@@ -1357,9 +1045,9 @@
|
|
|
1357
1045
|
</div>
|
|
1358
1046
|
|
|
1359
1047
|
<div class="method_details ">
|
|
1360
|
-
<h3 class="signature " id="
|
|
1048
|
+
<h3 class="signature " id="content_before_root_comp_block-class_method">
|
|
1361
1049
|
|
|
1362
|
-
.<strong>
|
|
1050
|
+
.<strong>content_before_root_comp_block</strong> ⇒ <tt>Object</tt>
|
|
1363
1051
|
|
|
1364
1052
|
|
|
1365
1053
|
|
|
@@ -1368,7 +1056,7 @@
|
|
|
1368
1056
|
</h3><div class="docstring">
|
|
1369
1057
|
<div class="discussion">
|
|
1370
1058
|
|
|
1371
|
-
<p>Getter for
|
|
1059
|
+
<p>Getter for content_before_root_comp_block</p>
|
|
1372
1060
|
|
|
1373
1061
|
|
|
1374
1062
|
</div>
|
|
@@ -1379,7 +1067,7 @@
|
|
|
1379
1067
|
<p class="tag_title">See Also:</p>
|
|
1380
1068
|
<ul class="see">
|
|
1381
1069
|
|
|
1382
|
-
<li>#
|
|
1070
|
+
<li>#content_before_root_comp=</li>
|
|
1383
1071
|
|
|
1384
1072
|
</ul>
|
|
1385
1073
|
|
|
@@ -1389,15 +1077,15 @@
|
|
|
1389
1077
|
<pre class="lines">
|
|
1390
1078
|
|
|
1391
1079
|
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1080
|
+
110
|
|
1081
|
+
111
|
|
1082
|
+
112</pre>
|
|
1395
1083
|
</td>
|
|
1396
1084
|
<td>
|
|
1397
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1085
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 110</span>
|
|
1398
1086
|
|
|
1399
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1400
|
-
<span class='ivar'>@
|
|
1087
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_before_root_comp_block'>content_before_root_comp_block</span>
|
|
1088
|
+
<span class='ivar'>@content_before_root_comp_block</span>
|
|
1401
1089
|
<span class='kw'>end</span></pre>
|
|
1402
1090
|
</td>
|
|
1403
1091
|
</tr>
|
|
@@ -1405,9 +1093,9 @@
|
|
|
1405
1093
|
</div>
|
|
1406
1094
|
|
|
1407
1095
|
<div class="method_details ">
|
|
1408
|
-
<h3 class="signature " id="
|
|
1096
|
+
<h3 class="signature " id="default_button_style-class_method">
|
|
1409
1097
|
|
|
1410
|
-
.<strong>
|
|
1098
|
+
.<strong>default_button_style</strong> ⇒ <tt>Object</tt>
|
|
1411
1099
|
|
|
1412
1100
|
|
|
1413
1101
|
|
|
@@ -1416,7 +1104,7 @@
|
|
|
1416
1104
|
</h3><div class="docstring">
|
|
1417
1105
|
<div class="discussion">
|
|
1418
1106
|
|
|
1419
|
-
<p>
|
|
1107
|
+
<p>Getter for the default button style, defaults to <code>:css_button</code>.</p>
|
|
1420
1108
|
|
|
1421
1109
|
|
|
1422
1110
|
</div>
|
|
@@ -1424,23 +1112,28 @@
|
|
|
1424
1112
|
<div class="tags">
|
|
1425
1113
|
|
|
1426
1114
|
|
|
1115
|
+
<p class="tag_title">See Also:</p>
|
|
1116
|
+
<ul class="see">
|
|
1117
|
+
|
|
1118
|
+
<li>{Compony{Compony#default_button_style=}</li>
|
|
1119
|
+
|
|
1120
|
+
</ul>
|
|
1121
|
+
|
|
1427
1122
|
</div><table class="source_code">
|
|
1428
1123
|
<tr>
|
|
1429
1124
|
<td>
|
|
1430
1125
|
<pre class="lines">
|
|
1431
1126
|
|
|
1432
1127
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
48</pre>
|
|
1128
|
+
92
|
|
1129
|
+
93
|
|
1130
|
+
94</pre>
|
|
1437
1131
|
</td>
|
|
1438
1132
|
<td>
|
|
1439
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1133
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 92</span>
|
|
1440
1134
|
|
|
1441
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1442
|
-
<span class='
|
|
1443
|
-
<span class='ivar'>@content_before_root_comp_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
|
1135
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_button_style'>default_button_style</span>
|
|
1136
|
+
<span class='kw'>return</span> <span class='ivar'>@default_button_style</span> <span class='op'>||</span> <span class='symbol'>:css_button</span>
|
|
1444
1137
|
<span class='kw'>end</span></pre>
|
|
1445
1138
|
</td>
|
|
1446
1139
|
</tr>
|
|
@@ -1448,9 +1141,9 @@
|
|
|
1448
1141
|
</div>
|
|
1449
1142
|
|
|
1450
1143
|
<div class="method_details ">
|
|
1451
|
-
<h3 class="signature " id="
|
|
1144
|
+
<h3 class="signature " id="default_button_style=-class_method">
|
|
1452
1145
|
|
|
1453
|
-
.<strong>
|
|
1146
|
+
.<strong>default_button_style=</strong>(default_button_style) ⇒ <tt>Object</tt>
|
|
1454
1147
|
|
|
1455
1148
|
|
|
1456
1149
|
|
|
@@ -1459,18 +1152,38 @@
|
|
|
1459
1152
|
</h3><div class="docstring">
|
|
1460
1153
|
<div class="discussion">
|
|
1461
1154
|
|
|
1462
|
-
<p>
|
|
1155
|
+
<p>Setter for the default button style. Defaults to :css_button.</p>
|
|
1463
1156
|
|
|
1464
1157
|
|
|
1465
1158
|
</div>
|
|
1466
1159
|
</div>
|
|
1467
1160
|
<div class="tags">
|
|
1161
|
+
<p class="tag_title">Parameters:</p>
|
|
1162
|
+
<ul class="param">
|
|
1163
|
+
|
|
1164
|
+
<li>
|
|
1165
|
+
|
|
1166
|
+
<span class='name'>default_button_style</span>
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
—
|
|
1174
|
+
<div class='inline'>
|
|
1175
|
+
<p>Name of the style that should be used as default.</p>
|
|
1176
|
+
</div>
|
|
1177
|
+
|
|
1178
|
+
</li>
|
|
1468
1179
|
|
|
1180
|
+
</ul>
|
|
1181
|
+
|
|
1469
1182
|
|
|
1470
1183
|
<p class="tag_title">See Also:</p>
|
|
1471
1184
|
<ul class="see">
|
|
1472
1185
|
|
|
1473
|
-
<li
|
|
1186
|
+
<li>{Compony{Compony#default_button_style}</li>
|
|
1474
1187
|
|
|
1475
1188
|
</ul>
|
|
1476
1189
|
|
|
@@ -1480,15 +1193,15 @@
|
|
|
1480
1193
|
<pre class="lines">
|
|
1481
1194
|
|
|
1482
1195
|
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1196
|
+
23
|
|
1197
|
+
24
|
|
1198
|
+
25</pre>
|
|
1486
1199
|
</td>
|
|
1487
1200
|
<td>
|
|
1488
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1201
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 23</span>
|
|
1489
1202
|
|
|
1490
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1491
|
-
<span class='ivar'>@
|
|
1203
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_button_style='>default_button_style=</span><span class='lparen'>(</span><span class='id identifier rubyid_default_button_style'>default_button_style</span><span class='rparen'>)</span>
|
|
1204
|
+
<span class='ivar'>@default_button_style</span> <span class='op'>=</span> <span class='id identifier rubyid_default_button_style'>default_button_style</span>
|
|
1492
1205
|
<span class='kw'>end</span></pre>
|
|
1493
1206
|
</td>
|
|
1494
1207
|
</tr>
|
|
@@ -1541,16 +1254,16 @@
|
|
|
1541
1254
|
<pre class="lines">
|
|
1542
1255
|
|
|
1543
1256
|
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1257
|
+
165
|
|
1258
|
+
166
|
|
1259
|
+
167
|
|
1260
|
+
168
|
|
1261
|
+
169
|
|
1262
|
+
170
|
|
1263
|
+
171</pre>
|
|
1551
1264
|
</td>
|
|
1552
1265
|
<td>
|
|
1553
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1266
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 165</span>
|
|
1554
1267
|
|
|
1555
1268
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_family_name_for'>family_name_for</span><span class='lparen'>(</span><span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span>
|
|
1556
1269
|
<span class='kw'>if</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:model_name</span><span class='rparen'>)</span>
|
|
@@ -1562,6 +1275,55 @@
|
|
|
1562
1275
|
</td>
|
|
1563
1276
|
</tr>
|
|
1564
1277
|
</table>
|
|
1278
|
+
</div>
|
|
1279
|
+
|
|
1280
|
+
<div class="method_details ">
|
|
1281
|
+
<h3 class="signature " id="intent-class_method">
|
|
1282
|
+
|
|
1283
|
+
.<strong>intent</strong>(intent_or_comp_args) ⇒ <tt>Object</tt>
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
</h3><div class="docstring">
|
|
1290
|
+
<div class="discussion">
|
|
1291
|
+
|
|
1292
|
+
<p>Pure helper to create a Compony Intent. If given an intent, will return it unchanged. Otherwise, will give all params to the intent initializer.</p>
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
</div>
|
|
1296
|
+
</div>
|
|
1297
|
+
<div class="tags">
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
</div><table class="source_code">
|
|
1301
|
+
<tr>
|
|
1302
|
+
<td>
|
|
1303
|
+
<pre class="lines">
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
125
|
|
1307
|
+
126
|
|
1308
|
+
127
|
|
1309
|
+
128
|
|
1310
|
+
129
|
|
1311
|
+
130
|
|
1312
|
+
131</pre>
|
|
1313
|
+
</td>
|
|
1314
|
+
<td>
|
|
1315
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 125</span>
|
|
1316
|
+
|
|
1317
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_intent'>intent</span><span class='lparen'>(</span><span class='id identifier rubyid_intent_or_comp_args'>intent_or_comp_args</span><span class='comma'>,</span> <span class='op'>...</span><span class='rparen'>)</span>
|
|
1318
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_intent_or_comp_args'>intent_or_comp_args</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">Intent</a></span></span><span class='rparen'>)</span>
|
|
1319
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_intent_or_comp_args'>intent_or_comp_args</span>
|
|
1320
|
+
<span class='kw'>else</span>
|
|
1321
|
+
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">Intent</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Compony/Intent.html#initialize-instance_method" title="Compony::Intent#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_intent_or_comp_args'>intent_or_comp_args</span><span class='comma'>,</span> <span class='op'>...</span><span class='rparen'>)</span>
|
|
1322
|
+
<span class='kw'>end</span>
|
|
1323
|
+
<span class='kw'>end</span></pre>
|
|
1324
|
+
</td>
|
|
1325
|
+
</tr>
|
|
1326
|
+
</table>
|
|
1565
1327
|
</div>
|
|
1566
1328
|
|
|
1567
1329
|
<div class="method_details ">
|
|
@@ -1610,18 +1372,18 @@
|
|
|
1610
1372
|
<pre class="lines">
|
|
1611
1373
|
|
|
1612
1374
|
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1375
|
+
175
|
|
1376
|
+
176
|
|
1377
|
+
177
|
|
1378
|
+
178
|
|
1379
|
+
179
|
|
1380
|
+
180
|
|
1381
|
+
181
|
|
1382
|
+
182
|
|
1383
|
+
183</pre>
|
|
1622
1384
|
</td>
|
|
1623
1385
|
<td>
|
|
1624
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1386
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 175</span>
|
|
1625
1387
|
|
|
1626
1388
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_model_field_class_for'>model_field_class_for</span><span class='lparen'>(</span><span class='id identifier rubyid_constant'>constant</span><span class='rparen'>)</span>
|
|
1627
1389
|
<span class='id identifier rubyid_model_field_namespaces'>model_field_namespaces</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_model_field_namespace'>model_field_namespace</span><span class='op'>|</span>
|
|
@@ -1670,12 +1432,12 @@
|
|
|
1670
1432
|
<pre class="lines">
|
|
1671
1433
|
|
|
1672
1434
|
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1435
|
+
98
|
|
1436
|
+
99
|
|
1437
|
+
100</pre>
|
|
1676
1438
|
</td>
|
|
1677
1439
|
<td>
|
|
1678
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1440
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 98</span>
|
|
1679
1441
|
|
|
1680
1442
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_model_field_namespaces'>model_field_namespaces</span>
|
|
1681
1443
|
<span class='kw'>return</span> <span class='ivar'>@model_field_namespaces</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Compony::ModelFields</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
@@ -1731,12 +1493,12 @@
|
|
|
1731
1493
|
<pre class="lines">
|
|
1732
1494
|
|
|
1733
1495
|
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1496
|
+
34
|
|
1497
|
+
35
|
|
1498
|
+
36</pre>
|
|
1737
1499
|
</td>
|
|
1738
1500
|
<td>
|
|
1739
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1501
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 34</span>
|
|
1740
1502
|
|
|
1741
1503
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_model_field_namespaces='>model_field_namespaces=</span><span class='lparen'>(</span><span class='id identifier rubyid_model_field_namespaces'>model_field_namespaces</span><span class='rparen'>)</span>
|
|
1742
1504
|
<span class='ivar'>@model_field_namespaces</span> <span class='op'>=</span> <span class='id identifier rubyid_model_field_namespaces'>model_field_namespaces</span>
|
|
@@ -1749,7 +1511,7 @@
|
|
|
1749
1511
|
<div class="method_details ">
|
|
1750
1512
|
<h3 class="signature " id="path-class_method">
|
|
1751
1513
|
|
|
1752
|
-
.<strong>path</strong>(comp_name_or_cst_or_class, model_or_family_name_or_cst = nil
|
|
1514
|
+
.<strong>path</strong>(comp_name_or_cst_or_class, model_or_family_name_or_cst = nil) ⇒ <tt>Object</tt>
|
|
1753
1515
|
|
|
1754
1516
|
|
|
1755
1517
|
|
|
@@ -1758,181 +1520,29 @@
|
|
|
1758
1520
|
</h3><div class="docstring">
|
|
1759
1521
|
<div class="discussion">
|
|
1760
1522
|
|
|
1761
|
-
<p>Generates a Rails path to a component. Examples: <code>Compony.path(:index, :users)</code>, <code>Compony.path(:show, User.first)</code></p>
|
|
1523
|
+
<p>Generates a Rails path to a component. Examples: <code>Compony.path(:index, :users)</code>, <code>Compony.path(:show, User.first)</code> The first two arguments are given to create an <span class='object_link'><a href="Compony/Intent.html" title="Compony::Intent (class)">Intent</a></span> and all subsequend args and all kwargs are given to <span class='object_link'><a href="Compony/Intent.html#path-instance_method" title="Compony::Intent#path (method)">Compony::Intent#path</a></span></p>
|
|
1762
1524
|
|
|
1763
1525
|
|
|
1764
1526
|
</div>
|
|
1765
1527
|
</div>
|
|
1766
1528
|
<div class="tags">
|
|
1767
|
-
<p class="tag_title">Parameters:</p>
|
|
1768
|
-
<ul class="param">
|
|
1769
|
-
|
|
1770
|
-
<li>
|
|
1771
|
-
|
|
1772
|
-
<span class='name'>comp_name_or_cst_or_class</span>
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
—
|
|
1780
|
-
<div class='inline'>
|
|
1781
|
-
<p>The component that should be loaded, for instance <code>ShowForAll</code>, <code>'ShowForAll'</code> or <code>:show_for_all</code> or can also pass a component class (such as Components::Users::Show)</p>
|
|
1782
|
-
</div>
|
|
1783
|
-
|
|
1784
|
-
</li>
|
|
1785
|
-
|
|
1786
|
-
<li>
|
|
1787
|
-
|
|
1788
|
-
<span class='name'>model_or_family_name_or_cst</span>
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>ApplicationRecord</tt>)</span>
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
—
|
|
1798
|
-
<div class='inline'>
|
|
1799
|
-
<p>Either the family that contains the requested component, or an instance implementing <code>model_name</code> from which the family name is auto-generated. Examples: <code>Users</code>, <code>'Users'</code>, <code>:users</code>, <code>User.first</code></p>
|
|
1800
|
-
</div>
|
|
1801
|
-
|
|
1802
|
-
</li>
|
|
1803
|
-
|
|
1804
|
-
<li>
|
|
1805
|
-
|
|
1806
|
-
<span class='name'>standalone_name</span>
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
<span class='type'>(<tt>Symbol</tt>, <tt>nil</tt>)</span>
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
—
|
|
1816
|
-
<div class='inline'>
|
|
1817
|
-
<p>Name of the standalone config to point to (defaults to nil the default standalone config).</p>
|
|
1818
|
-
</div>
|
|
1819
|
-
|
|
1820
|
-
</li>
|
|
1821
|
-
|
|
1822
|
-
<li>
|
|
1823
|
-
|
|
1824
|
-
<span class='name'>args_for_path_helper</span>
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
<span class='type'>(<tt>Array</tt>)</span>
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
—
|
|
1832
|
-
<div class='inline'>
|
|
1833
|
-
<p>Positional arguments passed to the Rails helper</p>
|
|
1834
|
-
</div>
|
|
1835
|
-
|
|
1836
|
-
</li>
|
|
1837
|
-
|
|
1838
|
-
<li>
|
|
1839
|
-
|
|
1840
|
-
<span class='name'>kwargs_for_path_helper</span>
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
—
|
|
1848
|
-
<div class='inline'>
|
|
1849
|
-
<p>Named arguments passed to the Rails helper. If a model is given to <code>model_or_family_name_or_cst</code>, the param <code>id</code> defaults to the passed model’s ID.</p>
|
|
1850
|
-
</div>
|
|
1851
|
-
|
|
1852
|
-
</li>
|
|
1853
|
-
|
|
1854
|
-
</ul>
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
</div><table class="source_code">
|
|
1858
|
-
<tr>
|
|
1859
|
-
<td>
|
|
1860
|
-
<pre class="lines">
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
107
|
|
1864
|
-
108
|
|
1865
|
-
109
|
|
1866
|
-
110
|
|
1867
|
-
111
|
|
1868
|
-
112
|
|
1869
|
-
113
|
|
1870
|
-
114
|
|
1871
|
-
115
|
|
1872
|
-
116</pre>
|
|
1873
|
-
</td>
|
|
1874
|
-
<td>
|
|
1875
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 107</span>
|
|
1876
|
-
|
|
1877
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</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='rparen'>)</span>
|
|
1878
|
-
<span class='comment'># Extract model if any, to get the ID
|
|
1879
|
-
</span> <span class='id identifier rubyid_model'>model</span> <span class='op'>=</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:model_name</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
|
1880
|
-
<span class='id identifier rubyid_comp_class'>comp_class</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span> <span class='op'><=</span> <span class='const'><span class='object_link'><a href="" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Compony/Component.html" title="Compony::Component (class)">Component</a></span></span><span class='rparen'>)</span>
|
|
1881
|
-
<span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span>
|
|
1882
|
-
<span class='kw'>else</span>
|
|
1883
|
-
<span class='id identifier rubyid_comp_class_for!'>comp_class_for!</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span>
|
|
1884
|
-
<span class='kw'>end</span>
|
|
1885
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_comp_class'>comp_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</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='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs_for_path_helper'>kwargs_for_path_helper</span><span class='rparen'>)</span>
|
|
1886
|
-
<span class='kw'>end</span></pre>
|
|
1887
|
-
</td>
|
|
1888
|
-
</tr>
|
|
1889
|
-
</table>
|
|
1890
|
-
</div>
|
|
1891
|
-
|
|
1892
|
-
<div class="method_details ">
|
|
1893
|
-
<h3 class="signature " id="path_helper_name-class_method">
|
|
1894
|
-
|
|
1895
|
-
.<strong>path_helper_name</strong> ⇒ <tt>Object</tt>
|
|
1896
1529
|
|
|
1897
1530
|
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
</h3><div class="docstring">
|
|
1902
|
-
<div class="discussion">
|
|
1903
|
-
|
|
1904
|
-
<p>Given a component and a family, this returns the name of the Rails URL helper returning the path to this component.<br> The parameters are the same as for <span class='object_link'><a href="#rails_action_name-class_method" title="Compony.rails_action_name (method)">rails_action_name</a></span>.<br> Example usage: <code>send("#{path_helper_name(:index, :users)}_url)</code></p>
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
</div>
|
|
1908
|
-
</div>
|
|
1909
|
-
<div class="tags">
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
<p class="tag_title">See Also:</p>
|
|
1913
|
-
<ul class="see">
|
|
1914
|
-
|
|
1915
|
-
<li><span class='object_link'><a href="#path-class_method" title="Compony.path (method)">path</a></span></li>
|
|
1916
|
-
|
|
1917
|
-
<li><span class='object_link'><a href="#rails_action_name-class_method" title="Compony.rails_action_name (method)">rails_action_name for the accepted params</a></span></li>
|
|
1918
|
-
|
|
1919
|
-
</ul>
|
|
1920
|
-
|
|
1921
1531
|
</div><table class="source_code">
|
|
1922
1532
|
<tr>
|
|
1923
1533
|
<td>
|
|
1924
1534
|
<pre class="lines">
|
|
1925
1535
|
|
|
1926
1536
|
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1537
|
+
135
|
|
1538
|
+
136
|
|
1539
|
+
137</pre>
|
|
1930
1540
|
</td>
|
|
1931
1541
|
<td>
|
|
1932
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1542
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 135</span>
|
|
1933
1543
|
|
|
1934
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
1935
|
-
<span class='
|
|
1544
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>...</span><span class='rparen'>)</span>
|
|
1545
|
+
<span class='id identifier rubyid_intent'>intent</span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='comma'>,</span> <span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
|
|
1936
1546
|
<span class='kw'>end</span></pre>
|
|
1937
1547
|
</td>
|
|
1938
1548
|
</tr>
|
|
@@ -1940,9 +1550,9 @@
|
|
|
1940
1550
|
</div>
|
|
1941
1551
|
|
|
1942
1552
|
<div class="method_details ">
|
|
1943
|
-
<h3 class="signature " id="
|
|
1553
|
+
<h3 class="signature " id="register_button_style-class_method">
|
|
1944
1554
|
|
|
1945
|
-
.<strong>
|
|
1555
|
+
.<strong>register_button_style</strong>(name, button_component_class_name) ⇒ <tt>Object</tt>
|
|
1946
1556
|
|
|
1947
1557
|
|
|
1948
1558
|
|
|
@@ -1951,7 +1561,7 @@
|
|
|
1951
1561
|
</h3><div class="docstring">
|
|
1952
1562
|
<div class="discussion">
|
|
1953
1563
|
|
|
1954
|
-
<p>
|
|
1564
|
+
<p>Adds a button style that can be referred to when rendering an intent.</p>
|
|
1955
1565
|
|
|
1956
1566
|
|
|
1957
1567
|
</div>
|
|
@@ -1962,50 +1572,32 @@
|
|
|
1962
1572
|
|
|
1963
1573
|
<li>
|
|
1964
1574
|
|
|
1965
|
-
<span class='name'>
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
—
|
|
1973
|
-
<div class='inline'>
|
|
1974
|
-
<p>Name of the component the action points to.</p>
|
|
1975
|
-
</div>
|
|
1976
|
-
|
|
1977
|
-
</li>
|
|
1978
|
-
|
|
1979
|
-
<li>
|
|
1980
|
-
|
|
1981
|
-
<span class='name'>model_or_family_name_or_cst</span>
|
|
1575
|
+
<span class='name'>name</span>
|
|
1982
1576
|
|
|
1983
1577
|
|
|
1984
|
-
<span class='type'>(<tt>
|
|
1578
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
1985
1579
|
|
|
1986
1580
|
|
|
1987
1581
|
|
|
1988
1582
|
—
|
|
1989
1583
|
<div class='inline'>
|
|
1990
|
-
<p>Name of the
|
|
1584
|
+
<p>Name of the style. If it exists already, will override the style.</p>
|
|
1991
1585
|
</div>
|
|
1992
1586
|
|
|
1993
1587
|
</li>
|
|
1994
1588
|
|
|
1995
1589
|
<li>
|
|
1996
1590
|
|
|
1997
|
-
<span class='name'>
|
|
1998
|
-
|
|
1591
|
+
<span class='name'>button_component_class</span>
|
|
1999
1592
|
|
|
2000
|
-
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
2001
1593
|
|
|
1594
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
2002
1595
|
|
|
2003
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
2004
1596
|
|
|
2005
1597
|
|
|
2006
1598
|
—
|
|
2007
1599
|
<div class='inline'>
|
|
2008
|
-
<p>
|
|
1600
|
+
<p>String with the class name of the button component that will be instanciated to render the intent.</p>
|
|
2009
1601
|
</div>
|
|
2010
1602
|
|
|
2011
1603
|
</li>
|
|
@@ -2013,38 +1605,23 @@
|
|
|
2013
1605
|
</ul>
|
|
2014
1606
|
|
|
2015
1607
|
|
|
2016
|
-
<p class="tag_title">See Also:</p>
|
|
2017
|
-
<ul class="see">
|
|
2018
|
-
|
|
2019
|
-
<li><span class='object_link'><a href="#path-class_method" title="Compony.path (method)">path</a></span></li>
|
|
2020
|
-
|
|
2021
|
-
</ul>
|
|
2022
|
-
|
|
2023
1608
|
</div><table class="source_code">
|
|
2024
1609
|
<tr>
|
|
2025
1610
|
<td>
|
|
2026
1611
|
<pre class="lines">
|
|
2027
1612
|
|
|
2028
1613
|
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
159
|
|
2034
|
-
160
|
|
2035
|
-
161
|
|
2036
|
-
162</pre>
|
|
1614
|
+
15
|
|
1615
|
+
16
|
|
1616
|
+
17
|
|
1617
|
+
18</pre>
|
|
2037
1618
|
</td>
|
|
2038
1619
|
<td>
|
|
2039
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1620
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 15</span>
|
|
2040
1621
|
|
|
2041
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
|
2042
|
-
<span class='
|
|
2043
|
-
|
|
2044
|
-
<span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span> <span class='op'>=</span> <span class='id identifier rubyid_comp_class'>comp_class</span><span class='period'>.</span><span class='id identifier rubyid_comp_name'>comp_name</span>
|
|
2045
|
-
<span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span> <span class='op'>=</span> <span class='id identifier rubyid_comp_class'>comp_class</span><span class='period'>.</span><span class='id identifier rubyid_family_name'>family_name</span>
|
|
2046
|
-
<span class='kw'>end</span>
|
|
2047
|
-
<span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span><span class='comma'>,</span> <span class='id identifier rubyid_comp_name_or_cst_or_class'>comp_name_or_cst_or_class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='comma'>,</span> <span class='id identifier rubyid_family_name_for'>family_name_for</span><span class='lparen'>(</span><span class='id identifier rubyid_model_or_family_name_or_cst'>model_or_family_name_or_cst</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
1622
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register_button_style'>register_button_style</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_button_component_class_name'>button_component_class_name</span><span class='rparen'>)</span>
|
|
1623
|
+
<span class='ivar'>@button_component_class_names</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
1624
|
+
<span class='ivar'>@button_component_class_names</span><span class='lbracket'>[</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='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_button_component_class_name'>button_component_class_name</span>
|
|
2048
1625
|
<span class='kw'>end</span></pre>
|
|
2049
1626
|
</td>
|
|
2050
1627
|
</tr>
|
|
@@ -2077,12 +1654,12 @@
|
|
|
2077
1654
|
<pre class="lines">
|
|
2078
1655
|
|
|
2079
1656
|
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
1657
|
+
157
|
|
1658
|
+
158
|
|
1659
|
+
159</pre>
|
|
2083
1660
|
</td>
|
|
2084
1661
|
<td>
|
|
2085
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line
|
|
1662
|
+
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 157</span>
|
|
2086
1663
|
|
|
2087
1664
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_root_comp'>root_comp</span>
|
|
2088
1665
|
<span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:compony_root_comp</span><span class='rbracket'>]</span>
|
|
@@ -2090,117 +1667,6 @@
|
|
|
2090
1667
|
</td>
|
|
2091
1668
|
</tr>
|
|
2092
1669
|
</table>
|
|
2093
|
-
</div>
|
|
2094
|
-
|
|
2095
|
-
<div class="method_details ">
|
|
2096
|
-
<h3 class="signature " id="with_button_defaults-class_method">
|
|
2097
|
-
|
|
2098
|
-
.<strong>with_button_defaults</strong>(**keys_to_overwrite, &block) ⇒ <tt>Object</tt>
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
</h3><div class="docstring">
|
|
2105
|
-
<div class="discussion">
|
|
2106
|
-
|
|
2107
|
-
<p>Overwrites the keys of the current button defaults by the ones provided during the execution of a given block and restores them afterwords. This method is useful when the same set of options is to be given to a multitude of buttons.</p>
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
</div>
|
|
2111
|
-
</div>
|
|
2112
|
-
<div class="tags">
|
|
2113
|
-
<p class="tag_title">Parameters:</p>
|
|
2114
|
-
<ul class="param">
|
|
2115
|
-
|
|
2116
|
-
<li>
|
|
2117
|
-
|
|
2118
|
-
<span class='name'>keys_to_overwrite</span>
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
—
|
|
2126
|
-
<div class='inline'>
|
|
2127
|
-
<p>Options that should be given to the buttons within the block, with their values</p>
|
|
2128
|
-
</div>
|
|
2129
|
-
|
|
2130
|
-
</li>
|
|
2131
|
-
|
|
2132
|
-
<li>
|
|
2133
|
-
|
|
2134
|
-
<span class='name'>block</span>
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
<span class='type'>(<tt>Block</tt>)</span>
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
—
|
|
2142
|
-
<div class='inline'>
|
|
2143
|
-
<p>Within this block, all omitted button options point to <code>keys_to_overwrite</code></p>
|
|
2144
|
-
</div>
|
|
2145
|
-
|
|
2146
|
-
</li>
|
|
2147
|
-
|
|
2148
|
-
</ul>
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
</div><table class="source_code">
|
|
2152
|
-
<tr>
|
|
2153
|
-
<td>
|
|
2154
|
-
<pre class="lines">
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
241
|
|
2158
|
-
242
|
|
2159
|
-
243
|
|
2160
|
-
244
|
|
2161
|
-
245
|
|
2162
|
-
246
|
|
2163
|
-
247
|
|
2164
|
-
248
|
|
2165
|
-
249
|
|
2166
|
-
250
|
|
2167
|
-
251
|
|
2168
|
-
252
|
|
2169
|
-
253
|
|
2170
|
-
254
|
|
2171
|
-
255
|
|
2172
|
-
256
|
|
2173
|
-
257
|
|
2174
|
-
258
|
|
2175
|
-
259
|
|
2176
|
-
260</pre>
|
|
2177
|
-
</td>
|
|
2178
|
-
<td>
|
|
2179
|
-
<pre class="code"><span class="info file"># File 'lib/compony.rb', line 241</span>
|
|
2180
|
-
|
|
2181
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_with_button_defaults'>with_button_defaults</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_keys_to_overwrite'>keys_to_overwrite</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
2182
|
-
<span class='comment'># Lazy initialize butto_defaults store if it hasn't been yet
|
|
2183
|
-
</span> <span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
2184
|
-
<span class='id identifier rubyid_keys_to_overwrite'>keys_to_overwrite</span><span class='period'>.</span><span class='id identifier rubyid_transform_keys!'>transform_keys!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span>
|
|
2185
|
-
<span class='id identifier rubyid_old_values'>old_values</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
2186
|
-
<span class='id identifier rubyid_newly_defined_keys'>newly_defined_keys</span> <span class='op'>=</span> <span class='id identifier rubyid_keys_to_overwrite'>keys_to_overwrite</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span> <span class='op'>-</span> <span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
|
2187
|
-
<span class='id identifier rubyid_keys_to_overwrite'>keys_to_overwrite</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_new_value'>new_value</span><span class='op'>|</span>
|
|
2188
|
-
<span class='comment'># Assign new value
|
|
2189
|
-
</span> <span class='id identifier rubyid_old_values'>old_values</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
|
2190
|
-
<span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_value'>new_value</span>
|
|
2191
|
-
<span class='kw'>end</span>
|
|
2192
|
-
<span class='id identifier rubyid_return_value'>return_value</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
|
|
2193
|
-
<span class='comment'># Restore previous value
|
|
2194
|
-
</span> <span class='id identifier rubyid_keys_to_overwrite'>keys_to_overwrite</span><span class='period'>.</span><span class='id identifier rubyid_each_key'>each_key</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
|
2195
|
-
<span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_old_values'>old_values</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
|
2196
|
-
<span class='kw'>end</span>
|
|
2197
|
-
<span class='comment'># Undefine keys that were not there previously
|
|
2198
|
-
</span> <span class='id identifier rubyid_newly_defined_keys'>newly_defined_keys</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_key'>key</span><span class='op'>|</span> <span class='const'>RequestStore</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lbracket'>[</span><span class='symbol'>:button_defaults</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
2199
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_return_value'>return_value</span>
|
|
2200
|
-
<span class='kw'>end</span></pre>
|
|
2201
|
-
</td>
|
|
2202
|
-
</tr>
|
|
2203
|
-
</table>
|
|
2204
1670
|
</div>
|
|
2205
1671
|
|
|
2206
1672
|
</div>
|
|
@@ -2208,7 +1674,7 @@
|
|
|
2208
1674
|
</div>
|
|
2209
1675
|
|
|
2210
1676
|
<div id="footer">
|
|
2211
|
-
Generated on Thu Nov
|
|
1677
|
+
Generated on Thu Nov 27 16:02:22 2025 by
|
|
2212
1678
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2213
1679
|
0.9.34 (ruby-3.3.5).
|
|
2214
1680
|
</div>
|