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,453 @@
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::MethodAccessibleHash
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::MethodAccessibleHash";
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 (M)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Compony.html" title="Compony (module)">Compony</a></span></span>
41
+ &raquo;
42
+ <span class="title">MethodAccessibleHash</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::MethodAccessibleHash
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Hash</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Hash</li>
78
+
79
+ <li class="next">Compony::MethodAccessibleHash</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/compony/method_accessible_hash.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>This class is intended for configs with predefined interfaces and should be used with instances of Hash:<br> Example:<br></p>
108
+
109
+ <pre class="code ruby"><code class="ruby">instance_of_a_hash = Compony::MethodAccessibleHash.new
110
+ instance_of_a_hash.merge!({ foo: :bar })
111
+ instance_of_a_hash.foo --&gt; :bar
112
+ instance_of_a_hash.roo --&gt; nil
113
+ </code></pre>
114
+
115
+ <p>See: <a href="https://gist.github.com/kalsan/87826048ea0ade92ab1be93c0919b405">gist.github.com/kalsan/87826048ea0ade92ab1be93c0919b405</a></p>
116
+
117
+
118
+ </div>
119
+ </div>
120
+ <div class="tags">
121
+
122
+
123
+ </div>
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <h2>
132
+ Instance Method Summary
133
+ <small><a href="#" class="summary_toggle">collapse</a></small>
134
+ </h2>
135
+
136
+ <ul class="summary">
137
+
138
+ <li class="public ">
139
+ <span class="summary_signature">
140
+
141
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(hash = {}) &#x21d2; MethodAccessibleHash </a>
142
+
143
+
144
+
145
+ </span>
146
+
147
+
148
+ <span class="note title constructor">constructor</span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ <span class="summary_desc"><div class='inline'>
158
+ <p>Takes an optional hash as argument and constructs a new MethodAccessibleHash.</p>
159
+ </div></span>
160
+
161
+ </li>
162
+
163
+
164
+ <li class="public ">
165
+ <span class="summary_signature">
166
+
167
+ <a href="#merge-instance_method" title="#merge (instance method)">#<strong>merge</strong>(hash) &#x21d2; Object </a>
168
+
169
+
170
+
171
+ </span>
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+ <span class="summary_desc"><div class='inline'></div></span>
182
+
183
+ </li>
184
+
185
+
186
+ <li class="public ">
187
+ <span class="summary_signature">
188
+
189
+ <a href="#method_missing-instance_method" title="#method_missing (instance method)">#<strong>method_missing</strong>(method, *args) &#x21d2; Object </a>
190
+
191
+
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'></div></span>
204
+
205
+ </li>
206
+
207
+
208
+ <li class="public ">
209
+ <span class="summary_signature">
210
+
211
+ <a href="#respond_to_missing%3F-instance_method" title="#respond_to_missing? (instance method)">#<strong>respond_to_missing?</strong>(_method, _include_private = false) &#x21d2; Boolean </a>
212
+
213
+
214
+
215
+ </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
+ <div id="constructor_details" class="method_details_list">
235
+ <h2>Constructor Details</h2>
236
+
237
+ <div class="method_details first">
238
+ <h3 class="signature first" id="initialize-instance_method">
239
+
240
+ #<strong>initialize</strong>(hash = {}) &#x21d2; <tt><span class='object_link'><a href="" title="Compony::MethodAccessibleHash (class)">MethodAccessibleHash</a></span></tt>
241
+
242
+
243
+
244
+
245
+
246
+ </h3><div class="docstring">
247
+ <div class="discussion">
248
+
249
+ <p>Takes an optional hash as argument and constructs a new MethodAccessibleHash.</p>
250
+
251
+
252
+ </div>
253
+ </div>
254
+ <div class="tags">
255
+
256
+
257
+ </div><table class="source_code">
258
+ <tr>
259
+ <td>
260
+ <pre class="lines">
261
+
262
+
263
+ 15
264
+ 16
265
+ 17
266
+ 18
267
+ 19
268
+ 20
269
+ 21</pre>
270
+ </td>
271
+ <td>
272
+ <pre class="code"><span class="info file"># File 'lib/compony/method_accessible_hash.rb', line 15</span>
273
+
274
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
275
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
276
+
277
+ <span class='id identifier rubyid_hash'>hash</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_value'>value</span><span class='op'>|</span>
278
+ <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</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_value'>value</span>
279
+ <span class='kw'>end</span>
280
+ <span class='kw'>end</span></pre>
281
+ </td>
282
+ </tr>
283
+ </table>
284
+ </div>
285
+
286
+ </div>
287
+ <div id="method_missing_details" class="method_details_list">
288
+ <h2>Dynamic Method Handling</h2>
289
+ <p class="notice this">
290
+ This class handles dynamic methods through the <tt>method_missing</tt> method
291
+
292
+ </p>
293
+
294
+ <div class="method_details first">
295
+ <h3 class="signature first" id="method_missing-instance_method">
296
+
297
+ #<strong>method_missing</strong>(method, *args) &#x21d2; <tt>Object</tt>
298
+
299
+
300
+
301
+
302
+
303
+ </h3><div class="docstring">
304
+ <div class="discussion">
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+
311
+
312
+ </div><table class="source_code">
313
+ <tr>
314
+ <td>
315
+ <pre class="lines">
316
+
317
+
318
+ 29
319
+ 30
320
+ 31
321
+ 32
322
+ 33
323
+ 34
324
+ 35
325
+ 36</pre>
326
+ </td>
327
+ <td>
328
+ <pre class="code"><span class="info file"># File 'lib/compony/method_accessible_hash.rb', line 29</span>
329
+
330
+ <span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
331
+ <span class='kw'>if</span> <span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_end_with?'>end_with?</span><span class='lparen'>(</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>
332
+ <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>=$</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
333
+ <span class='kw'>self</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_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
334
+ <span class='kw'>else</span>
335
+ <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
336
+ <span class='kw'>end</span>
337
+ <span class='kw'>end</span></pre>
338
+ </td>
339
+ </tr>
340
+ </table>
341
+ </div>
342
+
343
+ </div>
344
+
345
+
346
+ <div id="instance_method_details" class="method_details_list">
347
+ <h2>Instance Method Details</h2>
348
+
349
+
350
+ <div class="method_details first">
351
+ <h3 class="signature first" id="merge-instance_method">
352
+
353
+ #<strong>merge</strong>(hash) &#x21d2; <tt>Object</tt>
354
+
355
+
356
+
357
+
358
+
359
+ </h3><div class="docstring">
360
+ <div class="discussion">
361
+
362
+
363
+ </div>
364
+ </div>
365
+ <div class="tags">
366
+
367
+
368
+ </div><table class="source_code">
369
+ <tr>
370
+ <td>
371
+ <pre class="lines">
372
+
373
+
374
+ 24
375
+ 25
376
+ 26</pre>
377
+ </td>
378
+ <td>
379
+ <pre class="code"><span class="info file"># File 'lib/compony/method_accessible_hash.rb', line 24</span>
380
+
381
+ <span class='kw'>def</span> <span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
382
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys'>symbolize_keys</span><span class='rparen'>)</span>
383
+ <span class='kw'>end</span></pre>
384
+ </td>
385
+ </tr>
386
+ </table>
387
+ </div>
388
+
389
+ <div class="method_details ">
390
+ <h3 class="signature " id="respond_to_missing?-instance_method">
391
+
392
+ #<strong>respond_to_missing?</strong>(_method, _include_private = false) &#x21d2; <tt>Boolean</tt>
393
+
394
+
395
+
396
+
397
+
398
+ </h3><div class="docstring">
399
+ <div class="discussion">
400
+
401
+
402
+ </div>
403
+ </div>
404
+ <div class="tags">
405
+
406
+ <p class="tag_title">Returns:</p>
407
+ <ul class="return">
408
+
409
+ <li>
410
+
411
+
412
+ <span class='type'>(<tt>Boolean</tt>)</span>
413
+
414
+
415
+
416
+ </li>
417
+
418
+ </ul>
419
+
420
+ </div><table class="source_code">
421
+ <tr>
422
+ <td>
423
+ <pre class="lines">
424
+
425
+
426
+ 39
427
+ 40
428
+ 41</pre>
429
+ </td>
430
+ <td>
431
+ <pre class="code"><span class="info file"># File 'lib/compony/method_accessible_hash.rb', line 39</span>
432
+
433
+ <span class='kw'>def</span> <span class='id identifier rubyid_respond_to_missing?'>respond_to_missing?</span><span class='lparen'>(</span><span class='id identifier rubyid__method'>_method</span><span class='comma'>,</span> <span class='id identifier rubyid__include_private'>_include_private</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
434
+ <span class='kw'>true</span>
435
+ <span class='kw'>end</span></pre>
436
+ </td>
437
+ </tr>
438
+ </table>
439
+ </div>
440
+
441
+ </div>
442
+
443
+ </div>
444
+
445
+ <div id="footer">
446
+ Generated on Wed Apr 24 17:14:06 2024 by
447
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
448
+ 0.9.34 (ruby-3.2.2).
449
+ </div>
450
+
451
+ </div>
452
+ </body>
453
+ </html>