compony 0.2.0 → 0.2.2
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 +25 -0
- data/Gemfile.lock +3 -3
- data/README.md +1397 -33
- data/Rakefile +6 -2
- data/TODO.md +1 -0
- data/VERSION +1 -0
- data/app/controllers/compony_controller.rb +3 -1
- data/compony.gemspec +7 -7
- data/config/locales/fr.yml +33 -0
- data/doc/ComponentGenerator.html +231 -0
- data/doc/Components.html +105 -0
- data/doc/ComponentsGenerator.html +203 -0
- data/doc/Compony/Component.html +2098 -0
- data/doc/Compony/ComponentMixins/Default/Labelling.html +406 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +539 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +588 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +577 -0
- data/doc/Compony/ComponentMixins/Default/Standalone.html +692 -0
- data/doc/Compony/ComponentMixins/Default.html +126 -0
- data/doc/Compony/ComponentMixins/Resourceful.html +1193 -0
- data/doc/Compony/ComponentMixins.html +126 -0
- data/doc/Compony/Components/Button.html +293 -0
- data/doc/Compony/Components/Destroy.html +384 -0
- data/doc/Compony/Components/Edit.html +462 -0
- data/doc/Compony/Components/Form.html +1112 -0
- data/doc/Compony/Components/New.html +462 -0
- data/doc/Compony/Components/WithForm.html +528 -0
- data/doc/Compony/Components.html +126 -0
- data/doc/Compony/ControllerMixin.html +136 -0
- data/doc/Compony/Engine.html +133 -0
- data/doc/Compony/MethodAccessibleHash.html +453 -0
- data/doc/Compony/ModelFields/Anchormodel.html +383 -0
- data/doc/Compony/ModelFields/Association.html +613 -0
- data/doc/Compony/ModelFields/Attachment.html +305 -0
- data/doc/Compony/ModelFields/Base.html +1066 -0
- data/doc/Compony/ModelFields/Boolean.html +232 -0
- data/doc/Compony/ModelFields/Color.html +299 -0
- data/doc/Compony/ModelFields/Currency.html +232 -0
- data/doc/Compony/ModelFields/Date.html +232 -0
- data/doc/Compony/ModelFields/Datetime.html +232 -0
- data/doc/Compony/ModelFields/Decimal.html +154 -0
- data/doc/Compony/ModelFields/Email.html +240 -0
- data/doc/Compony/ModelFields/Float.html +154 -0
- data/doc/Compony/ModelFields/Integer.html +154 -0
- data/doc/Compony/ModelFields/Percentage.html +232 -0
- data/doc/Compony/ModelFields/Phone.html +301 -0
- data/doc/Compony/ModelFields/RichText.html +232 -0
- data/doc/Compony/ModelFields/String.html +154 -0
- data/doc/Compony/ModelFields/Text.html +154 -0
- data/doc/Compony/ModelFields/Time.html +154 -0
- data/doc/Compony/ModelFields/Url.html +240 -0
- data/doc/Compony/ModelFields.html +126 -0
- data/doc/Compony/ModelMixin.html +524 -0
- data/doc/Compony/RequestContext.html +791 -0
- data/doc/Compony/Version.html +139 -0
- data/doc/Compony/ViewHelpers.html +443 -0
- data/doc/Compony.html +2156 -0
- data/doc/ComponyController.html +124 -0
- data/doc/_index.html +569 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file.README.html +1565 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/imgs/intro-example-destroy.png +0 -0
- data/doc/imgs/intro-example-edit.png +0 -0
- data/doc/imgs/intro-example-index.png +0 -0
- data/doc/imgs/intro-example-new.png +0 -0
- data/doc/imgs/intro-example-show.png +0 -0
- data/doc/index.html +1565 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1435 -0
- data/doc/resourceful_lifecycle.png +0 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/compony/component.rb +2 -1
- data/lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb +1 -1
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +14 -3
- data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +14 -5
- data/lib/compony/component_mixins/default/standalone.rb +10 -3
- data/lib/compony/components/form.rb +6 -1
- data/lib/compony/components/with_form.rb +14 -1
- data/lib/compony/model_fields/anchormodel.rb +0 -22
- data/lib/compony/model_mixin.rb +12 -2
- data/lib/compony/version.rb +1 -7
- data/logo.svg +133 -0
- metadata +83 -6
|
@@ -0,0 +1,791 @@
|
|
|
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::RequestContext
|
|
8
|
+
|
|
9
|
+
— 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::RequestContext";
|
|
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 (R)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../Compony.html" title="Compony (module)">Compony</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">RequestContext</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::RequestContext
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Dslblend::Base</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Dslblend::Base</li>
|
|
78
|
+
|
|
79
|
+
<li class="next">Compony::RequestContext</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/request_context.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
|
105
|
+
<div class="discussion">
|
|
106
|
+
|
|
107
|
+
<p>This encapsulates useful methods for accessing data within a request.</p>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tags">
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
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="#controller-instance_method" title="#controller (instance method)">#<strong>controller</strong> ⇒ 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'>
|
|
145
|
+
<p>Allow explicit access to the controller object.</p>
|
|
146
|
+
</div></span>
|
|
147
|
+
|
|
148
|
+
</li>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<li class="public ">
|
|
152
|
+
<span class="summary_signature">
|
|
153
|
+
|
|
154
|
+
<a href="#helpers-instance_method" title="#helpers (instance method)">#<strong>helpers</strong> ⇒ Object </a>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</span>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
<span class="note title readonly">readonly</span>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
174
|
+
|
|
175
|
+
</li>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<li class="public ">
|
|
179
|
+
<span class="summary_signature">
|
|
180
|
+
|
|
181
|
+
<a href="#local_assigns-instance_method" title="#local_assigns (instance method)">#<strong>local_assigns</strong> ⇒ Object </a>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
</span>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<span class="note title readonly">readonly</span>
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
201
|
+
|
|
202
|
+
</li>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</ul>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
<h2>
|
|
212
|
+
Instance Method Summary
|
|
213
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
214
|
+
</h2>
|
|
215
|
+
|
|
216
|
+
<ul class="summary">
|
|
217
|
+
|
|
218
|
+
<li class="public ">
|
|
219
|
+
<span class="summary_signature">
|
|
220
|
+
|
|
221
|
+
<a href="#component-instance_method" title="#component (instance method)">#<strong>component</strong> ⇒ Object </a>
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
</span>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
236
|
+
|
|
237
|
+
</li>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
<li class="public ">
|
|
241
|
+
<span class="summary_signature">
|
|
242
|
+
|
|
243
|
+
<a href="#evaluate_with_backfire-instance_method" title="#evaluate_with_backfire (instance method)">#<strong>evaluate_with_backfire</strong> ⇒ Object </a>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
</span>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
258
|
+
|
|
259
|
+
</li>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
<li class="public ">
|
|
263
|
+
<span class="summary_signature">
|
|
264
|
+
|
|
265
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(component, controller, *additional_providers, helpers: nil, locals: {}) ⇒ RequestContext </a>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
</span>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
<span class="note title constructor">constructor</span>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<span class="summary_desc"><div class='inline'>
|
|
282
|
+
<p>A new instance of RequestContext.</p>
|
|
283
|
+
</div></span>
|
|
284
|
+
|
|
285
|
+
</li>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<li class="public ">
|
|
289
|
+
<span class="summary_signature">
|
|
290
|
+
|
|
291
|
+
<a href="#method_missing-instance_method" title="#method_missing (instance method)">#<strong>method_missing</strong>(method, *args, **kwargs) ⇒ Object </a>
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</span>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<span class="summary_desc"><div class='inline'>
|
|
306
|
+
<p>Provide access to local assigns as if it were a Rails context.</p>
|
|
307
|
+
</div></span>
|
|
308
|
+
|
|
309
|
+
</li>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
<li class="public ">
|
|
313
|
+
<span class="summary_signature">
|
|
314
|
+
|
|
315
|
+
<a href="#request_context-instance_method" title="#request_context (instance method)">#<strong>request_context</strong> ⇒ Object </a>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
</span>
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
<span class="summary_desc"><div class='inline'>
|
|
330
|
+
<p>Explicit accessor to this object.</p>
|
|
331
|
+
</div></span>
|
|
332
|
+
|
|
333
|
+
</li>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<li class="public ">
|
|
337
|
+
<span class="summary_signature">
|
|
338
|
+
|
|
339
|
+
<a href="#respond_to_missing%3F-instance_method" title="#respond_to_missing? (instance method)">#<strong>respond_to_missing?</strong>(method, include_all) ⇒ Boolean </a>
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
</span>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
354
|
+
|
|
355
|
+
</li>
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
</ul>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
<div id="constructor_details" class="method_details_list">
|
|
363
|
+
<h2>Constructor Details</h2>
|
|
364
|
+
|
|
365
|
+
<div class="method_details first">
|
|
366
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
367
|
+
|
|
368
|
+
#<strong>initialize</strong>(component, controller, *additional_providers, helpers: nil, locals: {}) ⇒ <tt><span class='object_link'><a href="" title="Compony::RequestContext (class)">RequestContext</a></span></tt>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
</h3><div class="docstring">
|
|
375
|
+
<div class="discussion">
|
|
376
|
+
|
|
377
|
+
<p>Returns a new instance of RequestContext.</p>
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
<div class="tags">
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
</div><table class="source_code">
|
|
386
|
+
<tr>
|
|
387
|
+
<td>
|
|
388
|
+
<pre class="lines">
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
10
|
|
392
|
+
11
|
|
393
|
+
12
|
|
394
|
+
13
|
|
395
|
+
14
|
|
396
|
+
15
|
|
397
|
+
16
|
|
398
|
+
17
|
|
399
|
+
18</pre>
|
|
400
|
+
</td>
|
|
401
|
+
<td>
|
|
402
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 10</span>
|
|
403
|
+
|
|
404
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='id identifier rubyid_controller'>controller</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_additional_providers'>additional_providers</span><span class='comma'>,</span> <span class='label'>helpers:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>locals:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
405
|
+
<span class='comment'># DSL provider is this class, controller is an additional provider, main provider should be the component
|
|
406
|
+
</span> <span class='comment'># Note: we have to manually set the main provider here as the auto-detection sets it to the VerbDsl instance around the block,
|
|
407
|
+
</span> <span class='comment'># leading to undesired caching effects (e.g. components being re-used, even if the comp_opts have changed)
|
|
408
|
+
</span> <span class='ivar'>@controller</span> <span class='op'>=</span> <span class='id identifier rubyid_controller'>controller</span>
|
|
409
|
+
<span class='ivar'>@helpers</span> <span class='op'>=</span> <span class='id identifier rubyid_helpers'>helpers</span> <span class='op'>||</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
|
|
410
|
+
<span class='ivar'>@local_assigns</span> <span class='op'>=</span> <span class='id identifier rubyid_locals'>locals</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
|
|
411
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='ivar'>@helpers</span><span class='comma'>,</span> <span class='ivar'>@controller</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_additional_providers'>additional_providers</span><span class='comma'>,</span> <span class='label'>main_provider:</span> <span class='id identifier rubyid_component'>component</span><span class='rparen'>)</span>
|
|
412
|
+
<span class='kw'>end</span></pre>
|
|
413
|
+
</td>
|
|
414
|
+
</tr>
|
|
415
|
+
</table>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
</div>
|
|
419
|
+
<div id="method_missing_details" class="method_details_list">
|
|
420
|
+
<h2>Dynamic Method Handling</h2>
|
|
421
|
+
<p class="notice this">
|
|
422
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
|
423
|
+
|
|
424
|
+
</p>
|
|
425
|
+
|
|
426
|
+
<div class="method_details first">
|
|
427
|
+
<h3 class="signature first" id="method_missing-instance_method">
|
|
428
|
+
|
|
429
|
+
#<strong>method_missing</strong>(method, *args, **kwargs) ⇒ <tt>Object</tt>
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
</h3><div class="docstring">
|
|
436
|
+
<div class="discussion">
|
|
437
|
+
|
|
438
|
+
<p>Provide access to local assigns as if it were a Rails context</p>
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
<div class="tags">
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
</div><table class="source_code">
|
|
447
|
+
<tr>
|
|
448
|
+
<td>
|
|
449
|
+
<pre class="lines">
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
35
|
|
453
|
+
36
|
|
454
|
+
37
|
|
455
|
+
38</pre>
|
|
456
|
+
</td>
|
|
457
|
+
<td>
|
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 35</span>
|
|
459
|
+
|
|
460
|
+
<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'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='rparen'>)</span>
|
|
461
|
+
<span class='kw'>return</span> <span class='ivar'>@local_assigns</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='ivar'>@local_assigns</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
|
462
|
+
<span class='kw'>return</span> <span class='kw'>super</span>
|
|
463
|
+
<span class='kw'>end</span></pre>
|
|
464
|
+
</td>
|
|
465
|
+
</tr>
|
|
466
|
+
</table>
|
|
467
|
+
</div>
|
|
468
|
+
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
<div id="instance_attr_details" class="attr_details">
|
|
472
|
+
<h2>Instance Attribute Details</h2>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
<span id=""></span>
|
|
476
|
+
<div class="method_details first">
|
|
477
|
+
<h3 class="signature first" id="controller-instance_method">
|
|
478
|
+
|
|
479
|
+
#<strong>controller</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
</h3><div class="docstring">
|
|
486
|
+
<div class="discussion">
|
|
487
|
+
|
|
488
|
+
<p>Allow explicit access to the controller object. All controller methods are delgated.</p>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
</div>
|
|
492
|
+
</div>
|
|
493
|
+
<div class="tags">
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
</div><table class="source_code">
|
|
497
|
+
<tr>
|
|
498
|
+
<td>
|
|
499
|
+
<pre class="lines">
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
6
|
|
503
|
+
7
|
|
504
|
+
8</pre>
|
|
505
|
+
</td>
|
|
506
|
+
<td>
|
|
507
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 6</span>
|
|
508
|
+
|
|
509
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_controller'>controller</span>
|
|
510
|
+
<span class='ivar'>@controller</span>
|
|
511
|
+
<span class='kw'>end</span></pre>
|
|
512
|
+
</td>
|
|
513
|
+
</tr>
|
|
514
|
+
</table>
|
|
515
|
+
</div>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
<span id=""></span>
|
|
519
|
+
<div class="method_details ">
|
|
520
|
+
<h3 class="signature " id="helpers-instance_method">
|
|
521
|
+
|
|
522
|
+
#<strong>helpers</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
</h3><div class="docstring">
|
|
529
|
+
<div class="discussion">
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
<div class="tags">
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
</div><table class="source_code">
|
|
538
|
+
<tr>
|
|
539
|
+
<td>
|
|
540
|
+
<pre class="lines">
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
7
|
|
544
|
+
8
|
|
545
|
+
9</pre>
|
|
546
|
+
</td>
|
|
547
|
+
<td>
|
|
548
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 7</span>
|
|
549
|
+
|
|
550
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_helpers'>helpers</span>
|
|
551
|
+
<span class='ivar'>@helpers</span>
|
|
552
|
+
<span class='kw'>end</span></pre>
|
|
553
|
+
</td>
|
|
554
|
+
</tr>
|
|
555
|
+
</table>
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
<span id=""></span>
|
|
560
|
+
<div class="method_details ">
|
|
561
|
+
<h3 class="signature " id="local_assigns-instance_method">
|
|
562
|
+
|
|
563
|
+
#<strong>local_assigns</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
</h3><div class="docstring">
|
|
570
|
+
<div class="discussion">
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
<div class="tags">
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
</div><table class="source_code">
|
|
579
|
+
<tr>
|
|
580
|
+
<td>
|
|
581
|
+
<pre class="lines">
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
8
|
|
585
|
+
9
|
|
586
|
+
10</pre>
|
|
587
|
+
</td>
|
|
588
|
+
<td>
|
|
589
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 8</span>
|
|
590
|
+
|
|
591
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_local_assigns'>local_assigns</span>
|
|
592
|
+
<span class='ivar'>@local_assigns</span>
|
|
593
|
+
<span class='kw'>end</span></pre>
|
|
594
|
+
</td>
|
|
595
|
+
</tr>
|
|
596
|
+
</table>
|
|
597
|
+
</div>
|
|
598
|
+
|
|
599
|
+
</div>
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
<div id="instance_method_details" class="method_details_list">
|
|
603
|
+
<h2>Instance Method Details</h2>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<div class="method_details first">
|
|
607
|
+
<h3 class="signature first" id="component-instance_method">
|
|
608
|
+
|
|
609
|
+
#<strong>component</strong> ⇒ <tt>Object</tt>
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
</h3><div class="docstring">
|
|
616
|
+
<div class="discussion">
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
<div class="tags">
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
</div><table class="source_code">
|
|
625
|
+
<tr>
|
|
626
|
+
<td>
|
|
627
|
+
<pre class="lines">
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
24
|
|
631
|
+
25
|
|
632
|
+
26</pre>
|
|
633
|
+
</td>
|
|
634
|
+
<td>
|
|
635
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 24</span>
|
|
636
|
+
|
|
637
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_component'>component</span>
|
|
638
|
+
<span class='ivar'>@_main_provider</span>
|
|
639
|
+
<span class='kw'>end</span></pre>
|
|
640
|
+
</td>
|
|
641
|
+
</tr>
|
|
642
|
+
</table>
|
|
643
|
+
</div>
|
|
644
|
+
|
|
645
|
+
<div class="method_details ">
|
|
646
|
+
<h3 class="signature " id="evaluate_with_backfire-instance_method">
|
|
647
|
+
|
|
648
|
+
#<strong>evaluate_with_backfire</strong> ⇒ <tt>Object</tt>
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
</h3><div class="docstring">
|
|
655
|
+
<div class="discussion">
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
</div>
|
|
659
|
+
</div>
|
|
660
|
+
<div class="tags">
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
</div><table class="source_code">
|
|
664
|
+
<tr>
|
|
665
|
+
<td>
|
|
666
|
+
<pre class="lines">
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
20
|
|
670
|
+
21
|
|
671
|
+
22</pre>
|
|
672
|
+
</td>
|
|
673
|
+
<td>
|
|
674
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 20</span>
|
|
675
|
+
|
|
676
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_evaluate_with_backfire'>evaluate_with_backfire</span><span class='lparen'>(</span><span class='op'>&</span><span class='rparen'>)</span>
|
|
677
|
+
<span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='label'>backfire_vars:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='op'>&</span><span class='rparen'>)</span>
|
|
678
|
+
<span class='kw'>end</span></pre>
|
|
679
|
+
</td>
|
|
680
|
+
</tr>
|
|
681
|
+
</table>
|
|
682
|
+
</div>
|
|
683
|
+
|
|
684
|
+
<div class="method_details ">
|
|
685
|
+
<h3 class="signature " id="request_context-instance_method">
|
|
686
|
+
|
|
687
|
+
#<strong>request_context</strong> ⇒ <tt>Object</tt>
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
</h3><div class="docstring">
|
|
694
|
+
<div class="discussion">
|
|
695
|
+
|
|
696
|
+
<p>Explicit accessor to this object. As Dslblend hides where a method comes from, this makes code modifying the request context more explicit. This is for instance useful when a component wishes to extend the request context with a module in order to define methods directly on the context.</p>
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
</div>
|
|
700
|
+
</div>
|
|
701
|
+
<div class="tags">
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
</div><table class="source_code">
|
|
705
|
+
<tr>
|
|
706
|
+
<td>
|
|
707
|
+
<pre class="lines">
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
30
|
|
711
|
+
31
|
|
712
|
+
32</pre>
|
|
713
|
+
</td>
|
|
714
|
+
<td>
|
|
715
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 30</span>
|
|
716
|
+
|
|
717
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_request_context'>request_context</span>
|
|
718
|
+
<span class='kw'>self</span>
|
|
719
|
+
<span class='kw'>end</span></pre>
|
|
720
|
+
</td>
|
|
721
|
+
</tr>
|
|
722
|
+
</table>
|
|
723
|
+
</div>
|
|
724
|
+
|
|
725
|
+
<div class="method_details ">
|
|
726
|
+
<h3 class="signature " id="respond_to_missing?-instance_method">
|
|
727
|
+
|
|
728
|
+
#<strong>respond_to_missing?</strong>(method, include_all) ⇒ <tt>Boolean</tt>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
</h3><div class="docstring">
|
|
735
|
+
<div class="discussion">
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
</div>
|
|
739
|
+
</div>
|
|
740
|
+
<div class="tags">
|
|
741
|
+
|
|
742
|
+
<p class="tag_title">Returns:</p>
|
|
743
|
+
<ul class="return">
|
|
744
|
+
|
|
745
|
+
<li>
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
</li>
|
|
753
|
+
|
|
754
|
+
</ul>
|
|
755
|
+
|
|
756
|
+
</div><table class="source_code">
|
|
757
|
+
<tr>
|
|
758
|
+
<td>
|
|
759
|
+
<pre class="lines">
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
40
|
|
763
|
+
41
|
|
764
|
+
42
|
|
765
|
+
43</pre>
|
|
766
|
+
</td>
|
|
767
|
+
<td>
|
|
768
|
+
<pre class="code"><span class="info file"># File 'lib/compony/request_context.rb', line 40</span>
|
|
769
|
+
|
|
770
|
+
<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_all'>include_all</span><span class='rparen'>)</span>
|
|
771
|
+
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@local_assigns</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
|
772
|
+
<span class='kw'>return</span> <span class='kw'>super</span>
|
|
773
|
+
<span class='kw'>end</span></pre>
|
|
774
|
+
</td>
|
|
775
|
+
</tr>
|
|
776
|
+
</table>
|
|
777
|
+
</div>
|
|
778
|
+
|
|
779
|
+
</div>
|
|
780
|
+
|
|
781
|
+
</div>
|
|
782
|
+
|
|
783
|
+
<div id="footer">
|
|
784
|
+
Generated on Wed Apr 24 17:14:06 2024 by
|
|
785
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
786
|
+
0.9.34 (ruby-3.2.2).
|
|
787
|
+
</div>
|
|
788
|
+
|
|
789
|
+
</div>
|
|
790
|
+
</body>
|
|
791
|
+
</html>
|