compony 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile.lock +3 -3
  4. data/README.md +1397 -33
  5. data/Rakefile +6 -2
  6. data/TODO.md +1 -0
  7. data/VERSION +1 -0
  8. data/app/controllers/compony_controller.rb +3 -1
  9. data/compony.gemspec +7 -7
  10. data/config/locales/fr.yml +33 -0
  11. data/doc/ComponentGenerator.html +231 -0
  12. data/doc/Components.html +105 -0
  13. data/doc/ComponentsGenerator.html +203 -0
  14. data/doc/Compony/Component.html +2098 -0
  15. data/doc/Compony/ComponentMixins/Default/Labelling.html +406 -0
  16. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +539 -0
  17. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +588 -0
  18. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +577 -0
  19. data/doc/Compony/ComponentMixins/Default/Standalone.html +692 -0
  20. data/doc/Compony/ComponentMixins/Default.html +126 -0
  21. data/doc/Compony/ComponentMixins/Resourceful.html +1193 -0
  22. data/doc/Compony/ComponentMixins.html +126 -0
  23. data/doc/Compony/Components/Button.html +293 -0
  24. data/doc/Compony/Components/Destroy.html +384 -0
  25. data/doc/Compony/Components/Edit.html +462 -0
  26. data/doc/Compony/Components/Form.html +1112 -0
  27. data/doc/Compony/Components/New.html +462 -0
  28. data/doc/Compony/Components/WithForm.html +528 -0
  29. data/doc/Compony/Components.html +126 -0
  30. data/doc/Compony/ControllerMixin.html +136 -0
  31. data/doc/Compony/Engine.html +133 -0
  32. data/doc/Compony/MethodAccessibleHash.html +453 -0
  33. data/doc/Compony/ModelFields/Anchormodel.html +383 -0
  34. data/doc/Compony/ModelFields/Association.html +613 -0
  35. data/doc/Compony/ModelFields/Attachment.html +305 -0
  36. data/doc/Compony/ModelFields/Base.html +1066 -0
  37. data/doc/Compony/ModelFields/Boolean.html +232 -0
  38. data/doc/Compony/ModelFields/Color.html +299 -0
  39. data/doc/Compony/ModelFields/Currency.html +232 -0
  40. data/doc/Compony/ModelFields/Date.html +232 -0
  41. data/doc/Compony/ModelFields/Datetime.html +232 -0
  42. data/doc/Compony/ModelFields/Decimal.html +154 -0
  43. data/doc/Compony/ModelFields/Email.html +240 -0
  44. data/doc/Compony/ModelFields/Float.html +154 -0
  45. data/doc/Compony/ModelFields/Integer.html +154 -0
  46. data/doc/Compony/ModelFields/Percentage.html +232 -0
  47. data/doc/Compony/ModelFields/Phone.html +301 -0
  48. data/doc/Compony/ModelFields/RichText.html +232 -0
  49. data/doc/Compony/ModelFields/String.html +154 -0
  50. data/doc/Compony/ModelFields/Text.html +154 -0
  51. data/doc/Compony/ModelFields/Time.html +154 -0
  52. data/doc/Compony/ModelFields/Url.html +240 -0
  53. data/doc/Compony/ModelFields.html +126 -0
  54. data/doc/Compony/ModelMixin.html +524 -0
  55. data/doc/Compony/RequestContext.html +791 -0
  56. data/doc/Compony/Version.html +139 -0
  57. data/doc/Compony/ViewHelpers.html +443 -0
  58. data/doc/Compony.html +2156 -0
  59. data/doc/ComponyController.html +124 -0
  60. data/doc/_index.html +569 -0
  61. data/doc/class_list.html +51 -0
  62. data/doc/css/common.css +1 -0
  63. data/doc/css/full_list.css +58 -0
  64. data/doc/css/style.css +497 -0
  65. data/doc/file.README.html +1565 -0
  66. data/doc/file_list.html +56 -0
  67. data/doc/frames.html +17 -0
  68. data/doc/imgs/intro-example-destroy.png +0 -0
  69. data/doc/imgs/intro-example-edit.png +0 -0
  70. data/doc/imgs/intro-example-index.png +0 -0
  71. data/doc/imgs/intro-example-new.png +0 -0
  72. data/doc/imgs/intro-example-show.png +0 -0
  73. data/doc/index.html +1565 -0
  74. data/doc/js/app.js +314 -0
  75. data/doc/js/full_list.js +216 -0
  76. data/doc/js/jquery.js +4 -0
  77. data/doc/method_list.html +1435 -0
  78. data/doc/resourceful_lifecycle.png +0 -0
  79. data/doc/top-level-namespace.html +112 -0
  80. data/lib/compony/component.rb +2 -1
  81. data/lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb +1 -1
  82. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +14 -3
  83. data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +14 -5
  84. data/lib/compony/component_mixins/default/standalone.rb +10 -3
  85. data/lib/compony/components/form.rb +6 -1
  86. data/lib/compony/components/with_form.rb +14 -1
  87. data/lib/compony/model_fields/anchormodel.rb +0 -22
  88. data/lib/compony/model_mixin.rb +12 -2
  89. data/lib/compony/version.rb +1 -7
  90. data/logo.svg +133 -0
  91. metadata +83 -6
@@ -0,0 +1,1066 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Compony::ModelFields::Base
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Compony::ModelFields::Base";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (B)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ModelFields.html" title="Compony::ModelFields (module)">ModelFields</a></span></span>
41
+ &raquo;
42
+ <span class="title">Base</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Compony::ModelFields::Base
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Compony::ModelFields::Base</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/compony/model_fields/base.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <div class="docstring">
103
+ <div class="discussion">
104
+
105
+
106
+ </div>
107
+ </div>
108
+ <div class="tags">
109
+
110
+
111
+ </div><div id="subclasses">
112
+ <h2>Direct Known Subclasses</h2>
113
+ <p class="children"><span class='object_link'><a href="Anchormodel.html" title="Compony::ModelFields::Anchormodel (class)">Anchormodel</a></span>, <span class='object_link'><a href="Association.html" title="Compony::ModelFields::Association (class)">Association</a></span>, <span class='object_link'><a href="Attachment.html" title="Compony::ModelFields::Attachment (class)">Attachment</a></span>, <span class='object_link'><a href="Boolean.html" title="Compony::ModelFields::Boolean (class)">Boolean</a></span>, <span class='object_link'><a href="Color.html" title="Compony::ModelFields::Color (class)">Color</a></span>, <span class='object_link'><a href="Currency.html" title="Compony::ModelFields::Currency (class)">Currency</a></span>, <span class='object_link'><a href="Date.html" title="Compony::ModelFields::Date (class)">Date</a></span>, <span class='object_link'><a href="Datetime.html" title="Compony::ModelFields::Datetime (class)">Datetime</a></span>, <span class='object_link'><a href="Decimal.html" title="Compony::ModelFields::Decimal (class)">Decimal</a></span>, <span class='object_link'><a href="Email.html" title="Compony::ModelFields::Email (class)">Email</a></span>, <span class='object_link'><a href="Float.html" title="Compony::ModelFields::Float (class)">Float</a></span>, <span class='object_link'><a href="Integer.html" title="Compony::ModelFields::Integer (class)">Integer</a></span>, <span class='object_link'><a href="Percentage.html" title="Compony::ModelFields::Percentage (class)">Percentage</a></span>, <span class='object_link'><a href="Phone.html" title="Compony::ModelFields::Phone (class)">Phone</a></span>, <span class='object_link'><a href="RichText.html" title="Compony::ModelFields::RichText (class)">RichText</a></span>, <span class='object_link'><a href="String.html" title="Compony::ModelFields::String (class)">String</a></span>, <span class='object_link'><a href="Text.html" title="Compony::ModelFields::Text (class)">Text</a></span>, <span class='object_link'><a href="Time.html" title="Compony::ModelFields::Time (class)">Time</a></span>, <span class='object_link'><a href="Url.html" title="Compony::ModelFields::Url (class)">Url</a></span></p>
114
+ </div>
115
+
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
120
+ <ul class="summary">
121
+
122
+ <li class="public ">
123
+ <span class="summary_signature">
124
+
125
+ <a href="#extra_attrs-instance_method" title="#extra_attrs (instance method)">#<strong>extra_attrs</strong> &#x21d2; Object </a>
126
+
127
+
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+ <span class="note title readonly">readonly</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'></div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#model_class-instance_method" title="#model_class (instance method)">#<strong>model_class</strong> &#x21d2; Object </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+ <span class="note title readonly">readonly</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'></div></span>
172
+
173
+ </li>
174
+
175
+
176
+ <li class="public ">
177
+ <span class="summary_signature">
178
+
179
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
180
+
181
+
182
+
183
+ </span>
184
+
185
+
186
+
187
+
188
+ <span class="note title readonly">readonly</span>
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+ <span class="summary_desc"><div class='inline'></div></span>
199
+
200
+ </li>
201
+
202
+
203
+ <li class="public ">
204
+ <span class="summary_signature">
205
+
206
+ <a href="#schema_key-instance_method" title="#schema_key (instance method)">#<strong>schema_key</strong> &#x21d2; Object </a>
207
+
208
+
209
+
210
+ </span>
211
+
212
+
213
+
214
+
215
+ <span class="note title readonly">readonly</span>
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+ <span class="summary_desc"><div class='inline'></div></span>
226
+
227
+ </li>
228
+
229
+
230
+ </ul>
231
+
232
+
233
+
234
+
235
+
236
+ <h2>
237
+ Instance Method Summary
238
+ <small><a href="#" class="summary_toggle">collapse</a></small>
239
+ </h2>
240
+
241
+ <ul class="summary">
242
+
243
+ <li class="public ">
244
+ <span class="summary_signature">
245
+
246
+ <a href="#association%3F-instance_method" title="#association? (instance method)">#<strong>association?</strong> &#x21d2; Boolean </a>
247
+
248
+
249
+
250
+ </span>
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+ <span class="summary_desc"><div class='inline'></div></span>
261
+
262
+ </li>
263
+
264
+
265
+ <li class="public ">
266
+ <span class="summary_signature">
267
+
268
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, model_class, **extra_attrs) &#x21d2; Base </a>
269
+
270
+
271
+
272
+ </span>
273
+
274
+
275
+ <span class="note title constructor">constructor</span>
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+ <span class="summary_desc"><div class='inline'>
285
+ <p>A new instance of Base.</p>
286
+ </div></span>
287
+
288
+ </li>
289
+
290
+
291
+ <li class="public ">
292
+ <span class="summary_signature">
293
+
294
+ <a href="#label-instance_method" title="#label (instance method)">#<strong>label</strong> &#x21d2; Object </a>
295
+
296
+
297
+
298
+ </span>
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+ <span class="summary_desc"><div class='inline'>
309
+ <p>Use this to display the label for this field, e.g.</p>
310
+ </div></span>
311
+
312
+ </li>
313
+
314
+
315
+ <li class="public ">
316
+ <span class="summary_signature">
317
+
318
+ <a href="#multi%3F-instance_method" title="#multi? (instance method)">#<strong>multi?</strong> &#x21d2; Boolean </a>
319
+
320
+
321
+
322
+ </span>
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+ <span class="summary_desc"><div class='inline'></div></span>
333
+
334
+ </li>
335
+
336
+
337
+ <li class="public ">
338
+ <span class="summary_signature">
339
+
340
+ <a href="#schema_line-instance_method" title="#schema_line (instance method)">#<strong>schema_line</strong> &#x21d2; Object </a>
341
+
342
+
343
+
344
+ </span>
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+ <span class="summary_desc"><div class='inline'>
355
+ <p>Used for auto-providing Schemacop schemas.</p>
356
+ </div></span>
357
+
358
+ </li>
359
+
360
+
361
+ <li class="public ">
362
+ <span class="summary_signature">
363
+
364
+ <a href="#simpleform_input-instance_method" title="#simpleform_input (instance method)">#<strong>simpleform_input</strong>(form, _component, name: nil, **input_opts) &#x21d2; Object </a>
365
+
366
+
367
+
368
+ </span>
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+ <span class="summary_desc"><div class='inline'>
379
+ <p>Used in form helper.</p>
380
+ </div></span>
381
+
382
+ </li>
383
+
384
+
385
+ <li class="public ">
386
+ <span class="summary_signature">
387
+
388
+ <a href="#simpleform_input_hidden-instance_method" title="#simpleform_input_hidden (instance method)">#<strong>simpleform_input_hidden</strong>(form, _component, name: nil, **input_opts) &#x21d2; Object </a>
389
+
390
+
391
+
392
+ </span>
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+ <span class="summary_desc"><div class='inline'>
403
+ <p>Used in form helper Given a simpleform instance, returns a suitable hidden input for thetype.</p>
404
+ </div></span>
405
+
406
+ </li>
407
+
408
+
409
+ <li class="protected ">
410
+ <span class="summary_signature">
411
+
412
+ <a href="#transform_and_join-instance_method" title="#transform_and_join (instance method)">#<strong>transform_and_join</strong>(data, controller:, &amp;transform_block) &#x21d2; Object </a>
413
+
414
+
415
+
416
+ </span>
417
+
418
+
419
+
420
+ <span class="note title protected">protected</span>
421
+
422
+
423
+
424
+
425
+
426
+ <span class="summary_desc"><div class='inline'>
427
+ <p>If given a scalar, calls the block on the scalar.</p>
428
+ </div></span>
429
+
430
+ </li>
431
+
432
+
433
+ <li class="public ">
434
+ <span class="summary_signature">
435
+
436
+ <a href="#value_for-instance_method" title="#value_for (instance method)">#<strong>value_for</strong>(data, controller: nil, **_) &#x21d2; Object </a>
437
+
438
+
439
+
440
+ </span>
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+ <span class="summary_desc"><div class='inline'>
451
+ <p>Use this to display the value for this field applied to data.</p>
452
+ </div></span>
453
+
454
+ </li>
455
+
456
+
457
+ </ul>
458
+
459
+
460
+ <div id="constructor_details" class="method_details_list">
461
+ <h2>Constructor Details</h2>
462
+
463
+ <div class="method_details first">
464
+ <h3 class="signature first" id="initialize-instance_method">
465
+
466
+ #<strong>initialize</strong>(name, model_class, **extra_attrs) &#x21d2; <tt><span class='object_link'><a href="" title="Compony::ModelFields::Base (class)">Base</a></span></tt>
467
+
468
+
469
+
470
+
471
+
472
+ </h3><div class="docstring">
473
+ <div class="discussion">
474
+
475
+ <p>Returns a new instance of Base.</p>
476
+
477
+
478
+ </div>
479
+ </div>
480
+ <div class="tags">
481
+
482
+
483
+ </div><table class="source_code">
484
+ <tr>
485
+ <td>
486
+ <pre class="lines">
487
+
488
+
489
+ 17
490
+ 18
491
+ 19
492
+ 20
493
+ 21
494
+ 22</pre>
495
+ </td>
496
+ <td>
497
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 17</span>
498
+
499
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_model_class'>model_class</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_extra_attrs'>extra_attrs</span><span class='rparen'>)</span>
500
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
501
+ <span class='ivar'>@model_class</span> <span class='op'>=</span> <span class='id identifier rubyid_model_class'>model_class</span>
502
+ <span class='ivar'>@schema_key</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
503
+ <span class='ivar'>@extra_attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_extra_attrs'>extra_attrs</span>
504
+ <span class='kw'>end</span></pre>
505
+ </td>
506
+ </tr>
507
+ </table>
508
+ </div>
509
+
510
+ </div>
511
+
512
+ <div id="instance_attr_details" class="attr_details">
513
+ <h2>Instance Attribute Details</h2>
514
+
515
+
516
+ <span id=""></span>
517
+ <div class="method_details first">
518
+ <h3 class="signature first" id="extra_attrs-instance_method">
519
+
520
+ #<strong>extra_attrs</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
521
+
522
+
523
+
524
+
525
+
526
+ </h3><div class="docstring">
527
+ <div class="discussion">
528
+
529
+
530
+ </div>
531
+ </div>
532
+ <div class="tags">
533
+
534
+
535
+ </div><table class="source_code">
536
+ <tr>
537
+ <td>
538
+ <pre class="lines">
539
+
540
+
541
+ 7
542
+ 8
543
+ 9</pre>
544
+ </td>
545
+ <td>
546
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 7</span>
547
+
548
+ <span class='kw'>def</span> <span class='id identifier rubyid_extra_attrs'>extra_attrs</span>
549
+ <span class='ivar'>@extra_attrs</span>
550
+ <span class='kw'>end</span></pre>
551
+ </td>
552
+ </tr>
553
+ </table>
554
+ </div>
555
+
556
+
557
+ <span id=""></span>
558
+ <div class="method_details ">
559
+ <h3 class="signature " id="model_class-instance_method">
560
+
561
+ #<strong>model_class</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
562
+
563
+
564
+
565
+
566
+
567
+ </h3><div class="docstring">
568
+ <div class="discussion">
569
+
570
+
571
+ </div>
572
+ </div>
573
+ <div class="tags">
574
+
575
+
576
+ </div><table class="source_code">
577
+ <tr>
578
+ <td>
579
+ <pre class="lines">
580
+
581
+
582
+ 5
583
+ 6
584
+ 7</pre>
585
+ </td>
586
+ <td>
587
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 5</span>
588
+
589
+ <span class='kw'>def</span> <span class='id identifier rubyid_model_class'>model_class</span>
590
+ <span class='ivar'>@model_class</span>
591
+ <span class='kw'>end</span></pre>
592
+ </td>
593
+ </tr>
594
+ </table>
595
+ </div>
596
+
597
+
598
+ <span id=""></span>
599
+ <div class="method_details ">
600
+ <h3 class="signature " id="name-instance_method">
601
+
602
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
603
+
604
+
605
+
606
+
607
+
608
+ </h3><div class="docstring">
609
+ <div class="discussion">
610
+
611
+
612
+ </div>
613
+ </div>
614
+ <div class="tags">
615
+
616
+
617
+ </div><table class="source_code">
618
+ <tr>
619
+ <td>
620
+ <pre class="lines">
621
+
622
+
623
+ 4
624
+ 5
625
+ 6</pre>
626
+ </td>
627
+ <td>
628
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 4</span>
629
+
630
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
631
+ <span class='ivar'>@name</span>
632
+ <span class='kw'>end</span></pre>
633
+ </td>
634
+ </tr>
635
+ </table>
636
+ </div>
637
+
638
+
639
+ <span id=""></span>
640
+ <div class="method_details ">
641
+ <h3 class="signature " id="schema_key-instance_method">
642
+
643
+ #<strong>schema_key</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
644
+
645
+
646
+
647
+
648
+
649
+ </h3><div class="docstring">
650
+ <div class="discussion">
651
+
652
+
653
+ </div>
654
+ </div>
655
+ <div class="tags">
656
+
657
+
658
+ </div><table class="source_code">
659
+ <tr>
660
+ <td>
661
+ <pre class="lines">
662
+
663
+
664
+ 6
665
+ 7
666
+ 8</pre>
667
+ </td>
668
+ <td>
669
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 6</span>
670
+
671
+ <span class='kw'>def</span> <span class='id identifier rubyid_schema_key'>schema_key</span>
672
+ <span class='ivar'>@schema_key</span>
673
+ <span class='kw'>end</span></pre>
674
+ </td>
675
+ </tr>
676
+ </table>
677
+ </div>
678
+
679
+ </div>
680
+
681
+
682
+ <div id="instance_method_details" class="method_details_list">
683
+ <h2>Instance Method Details</h2>
684
+
685
+
686
+ <div class="method_details first">
687
+ <h3 class="signature first" id="association?-instance_method">
688
+
689
+ #<strong>association?</strong> &#x21d2; <tt><span class='object_link'><a href="Boolean.html" title="Compony::ModelFields::Boolean (class)">Boolean</a></span></tt>
690
+
691
+
692
+
693
+
694
+
695
+ </h3><div class="docstring">
696
+ <div class="discussion">
697
+
698
+
699
+ </div>
700
+ </div>
701
+ <div class="tags">
702
+
703
+ <p class="tag_title">Returns:</p>
704
+ <ul class="return">
705
+
706
+ <li>
707
+
708
+
709
+ <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Compony::ModelFields::Boolean (class)">Boolean</a></span></tt>)</span>
710
+
711
+
712
+
713
+ </li>
714
+
715
+ </ul>
716
+
717
+ </div><table class="source_code">
718
+ <tr>
719
+ <td>
720
+ <pre class="lines">
721
+
722
+
723
+ 13
724
+ 14
725
+ 15</pre>
726
+ </td>
727
+ <td>
728
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 13</span>
729
+
730
+ <span class='kw'>def</span> <span class='id identifier rubyid_association?'>association?</span>
731
+ <span class='op'>!</span><span class='op'>!</span><span class='ivar'>@association</span>
732
+ <span class='kw'>end</span></pre>
733
+ </td>
734
+ </tr>
735
+ </table>
736
+ </div>
737
+
738
+ <div class="method_details ">
739
+ <h3 class="signature " id="label-instance_method">
740
+
741
+ #<strong>label</strong> &#x21d2; <tt>Object</tt>
742
+
743
+
744
+
745
+
746
+
747
+ </h3><div class="docstring">
748
+ <div class="discussion">
749
+
750
+ <p>Use this to display the label for this field, e.g. for columns, forms etc.</p>
751
+
752
+
753
+ </div>
754
+ </div>
755
+ <div class="tags">
756
+
757
+
758
+ </div><table class="source_code">
759
+ <tr>
760
+ <td>
761
+ <pre class="lines">
762
+
763
+
764
+ 25
765
+ 26
766
+ 27</pre>
767
+ </td>
768
+ <td>
769
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 25</span>
770
+
771
+ <span class='kw'>def</span> <span class='id identifier rubyid_label'>label</span>
772
+ <span class='ivar'>@model_class</span><span class='period'>.</span><span class='id identifier rubyid_human_attribute_name'>human_attribute_name</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span>
773
+ <span class='kw'>end</span></pre>
774
+ </td>
775
+ </tr>
776
+ </table>
777
+ </div>
778
+
779
+ <div class="method_details ">
780
+ <h3 class="signature " id="multi?-instance_method">
781
+
782
+ #<strong>multi?</strong> &#x21d2; <tt><span class='object_link'><a href="Boolean.html" title="Compony::ModelFields::Boolean (class)">Boolean</a></span></tt>
783
+
784
+
785
+
786
+
787
+
788
+ </h3><div class="docstring">
789
+ <div class="discussion">
790
+
791
+
792
+ </div>
793
+ </div>
794
+ <div class="tags">
795
+
796
+ <p class="tag_title">Returns:</p>
797
+ <ul class="return">
798
+
799
+ <li>
800
+
801
+
802
+ <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Compony::ModelFields::Boolean (class)">Boolean</a></span></tt>)</span>
803
+
804
+
805
+
806
+ </li>
807
+
808
+ </ul>
809
+
810
+ </div><table class="source_code">
811
+ <tr>
812
+ <td>
813
+ <pre class="lines">
814
+
815
+
816
+ 9
817
+ 10
818
+ 11</pre>
819
+ </td>
820
+ <td>
821
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 9</span>
822
+
823
+ <span class='kw'>def</span> <span class='id identifier rubyid_multi?'>multi?</span>
824
+ <span class='op'>!</span><span class='op'>!</span><span class='ivar'>@multi</span>
825
+ <span class='kw'>end</span></pre>
826
+ </td>
827
+ </tr>
828
+ </table>
829
+ </div>
830
+
831
+ <div class="method_details ">
832
+ <h3 class="signature " id="schema_line-instance_method">
833
+
834
+ #<strong>schema_line</strong> &#x21d2; <tt>Object</tt>
835
+
836
+
837
+
838
+
839
+
840
+ </h3><div class="docstring">
841
+ <div class="discussion">
842
+
843
+ <p>Used for auto-providing Schemacop schemas. Returns a proc that is meant for instance_exec within a Schemacop3 hash block</p>
844
+
845
+
846
+ </div>
847
+ </div>
848
+ <div class="tags">
849
+
850
+
851
+ </div><table class="source_code">
852
+ <tr>
853
+ <td>
854
+ <pre class="lines">
855
+
856
+
857
+ 37
858
+ 38
859
+ 39
860
+ 40
861
+ 41</pre>
862
+ </td>
863
+ <td>
864
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 37</span>
865
+
866
+ <span class='kw'>def</span> <span class='id identifier rubyid_schema_line'>schema_line</span>
867
+ <span class='comment'># Default behavior
868
+ </span> <span class='id identifier rubyid_local_schema_key'>local_schema_key</span> <span class='op'>=</span> <span class='ivar'>@schema_key</span> <span class='comment'># Capture schema_key as it will not be available within the lambda
869
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_proc'>proc</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_obj?'>obj?</span> <span class='id identifier rubyid_local_schema_key'>local_schema_key</span> <span class='rbrace'>}</span>
870
+ <span class='kw'>end</span></pre>
871
+ </td>
872
+ </tr>
873
+ </table>
874
+ </div>
875
+
876
+ <div class="method_details ">
877
+ <h3 class="signature " id="simpleform_input-instance_method">
878
+
879
+ #<strong>simpleform_input</strong>(form, _component, name: nil, **input_opts) &#x21d2; <tt>Object</tt>
880
+
881
+
882
+
883
+
884
+
885
+ </h3><div class="docstring">
886
+ <div class="discussion">
887
+
888
+ <p>Used in form helper. Given a simpleform instance, returns the corresponding input to be supplied to the view.</p>
889
+
890
+
891
+ </div>
892
+ </div>
893
+ <div class="tags">
894
+
895
+
896
+ </div><table class="source_code">
897
+ <tr>
898
+ <td>
899
+ <pre class="lines">
900
+
901
+
902
+ 45
903
+ 46
904
+ 47</pre>
905
+ </td>
906
+ <td>
907
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 45</span>
908
+
909
+ <span class='kw'>def</span> <span class='id identifier rubyid_simpleform_input'>simpleform_input</span><span class='lparen'>(</span><span class='id identifier rubyid_form'>form</span><span class='comma'>,</span> <span class='id identifier rubyid__component'>_component</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='rparen'>)</span>
910
+ <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='ivar'>@name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span>
911
+ <span class='kw'>end</span></pre>
912
+ </td>
913
+ </tr>
914
+ </table>
915
+ </div>
916
+
917
+ <div class="method_details ">
918
+ <h3 class="signature " id="simpleform_input_hidden-instance_method">
919
+
920
+ #<strong>simpleform_input_hidden</strong>(form, _component, name: nil, **input_opts) &#x21d2; <tt>Object</tt>
921
+
922
+
923
+
924
+
925
+
926
+ </h3><div class="docstring">
927
+ <div class="discussion">
928
+
929
+ <p>Used in form helper Given a simpleform instance, returns a suitable hidden input for thetype</p>
930
+
931
+
932
+ </div>
933
+ </div>
934
+ <div class="tags">
935
+
936
+
937
+ </div><table class="source_code">
938
+ <tr>
939
+ <td>
940
+ <pre class="lines">
941
+
942
+
943
+ 51
944
+ 52
945
+ 53</pre>
946
+ </td>
947
+ <td>
948
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 51</span>
949
+
950
+ <span class='kw'>def</span> <span class='id identifier rubyid_simpleform_input_hidden'>simpleform_input_hidden</span><span class='lparen'>(</span><span class='id identifier rubyid_form'>form</span><span class='comma'>,</span> <span class='id identifier rubyid__component'>_component</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='rparen'>)</span>
951
+ <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='ivar'>@name</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:hidden</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span>
952
+ <span class='kw'>end</span></pre>
953
+ </td>
954
+ </tr>
955
+ </table>
956
+ </div>
957
+
958
+ <div class="method_details ">
959
+ <h3 class="signature " id="transform_and_join-instance_method">
960
+
961
+ #<strong>transform_and_join</strong>(data, controller:, &amp;transform_block) &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
962
+
963
+
964
+
965
+
966
+
967
+ </h3><div class="docstring">
968
+ <div class="discussion">
969
+
970
+ <p>If given a scalar, calls the block on the scalar. If given a list, calls the block on every member and joins the result with “,”.</p>
971
+
972
+
973
+ </div>
974
+ </div>
975
+ <div class="tags">
976
+
977
+
978
+ </div><table class="source_code">
979
+ <tr>
980
+ <td>
981
+ <pre class="lines">
982
+
983
+
984
+ 58
985
+ 59
986
+ 60
987
+ 61
988
+ 62
989
+ 63
990
+ 64
991
+ 65
992
+ 66</pre>
993
+ </td>
994
+ <td>
995
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 58</span>
996
+
997
+ <span class='kw'>def</span> <span class='id identifier rubyid_transform_and_join'>transform_and_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_transform_block'>transform_block</span><span class='rparen'>)</span>
998
+ <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Enumerable</span><span class='rparen'>)</span>
999
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_transform_block'>transform_block</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1000
+ <span class='kw'>return</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_safe_join'>safe_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>, </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1001
+ <span class='kw'>else</span>
1002
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_transform_block'>transform_block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1003
+ <span class='kw'>return</span> <span class='id identifier rubyid_data'>data</span>
1004
+ <span class='kw'>end</span>
1005
+ <span class='kw'>end</span></pre>
1006
+ </td>
1007
+ </tr>
1008
+ </table>
1009
+ </div>
1010
+
1011
+ <div class="method_details ">
1012
+ <h3 class="signature " id="value_for-instance_method">
1013
+
1014
+ #<strong>value_for</strong>(data, controller: nil, **_) &#x21d2; <tt>Object</tt>
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+ </h3><div class="docstring">
1021
+ <div class="discussion">
1022
+
1023
+ <p>Use this to display the value for this field applied to data</p>
1024
+
1025
+
1026
+ </div>
1027
+ </div>
1028
+ <div class="tags">
1029
+
1030
+
1031
+ </div><table class="source_code">
1032
+ <tr>
1033
+ <td>
1034
+ <pre class="lines">
1035
+
1036
+
1037
+ 30
1038
+ 31
1039
+ 32
1040
+ 33</pre>
1041
+ </td>
1042
+ <td>
1043
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/base.rb', line 30</span>
1044
+
1045
+ <span class='kw'>def</span> <span class='id identifier rubyid_value_for'>value_for</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>controller:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid__'>_</span><span class='rparen'>)</span>
1046
+ <span class='comment'># Default behavior
1047
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_transform_and_join'>transform_and_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='rparen'>)</span>
1048
+ <span class='kw'>end</span></pre>
1049
+ </td>
1050
+ </tr>
1051
+ </table>
1052
+ </div>
1053
+
1054
+ </div>
1055
+
1056
+ </div>
1057
+
1058
+ <div id="footer">
1059
+ Generated on Wed Apr 24 17:14:06 2024 by
1060
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1061
+ 0.9.34 (ruby-3.2.2).
1062
+ </div>
1063
+
1064
+ </div>
1065
+ </body>
1066
+ </html>