ballast 1.0.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 +7 -0
- data/.gitignore +9 -0
- data/.travis-gemfile +15 -0
- data/.travis.yml +7 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +21 -0
- data/README.md +40 -0
- data/Rakefile +28 -0
- data/ballast.gemspec +35 -0
- data/doc/Ballast/Concerns/Ajax.html +806 -0
- data/doc/Ballast/Concerns/Common.html +900 -0
- data/doc/Ballast/Concerns/ErrorsHandling.html +283 -0
- data/doc/Ballast/Concerns/View.html +664 -0
- data/doc/Ballast/Concerns.html +127 -0
- data/doc/Ballast/Context.html +417 -0
- data/doc/Ballast/Errors/BaseError.html +326 -0
- data/doc/Ballast/Errors/InvalidDomain.html +157 -0
- data/doc/Ballast/Errors/PerformError.html +157 -0
- data/doc/Ballast/Errors/ValidationError.html +157 -0
- data/doc/Ballast/Errors.html +125 -0
- data/doc/Ballast/Operation.html +1304 -0
- data/doc/Ballast/OperationsChain.html +585 -0
- data/doc/Ballast/Version.html +189 -0
- data/doc/Ballast.html +130 -0
- data/doc/_index.html +267 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +115 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +115 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +269 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/ballast/concerns/ajax.rb +116 -0
- data/lib/ballast/concerns/common.rb +97 -0
- data/lib/ballast/concerns/errors_handling.rb +49 -0
- data/lib/ballast/concerns/view.rb +63 -0
- data/lib/ballast/context.rb +38 -0
- data/lib/ballast/errors.rb +34 -0
- data/lib/ballast/operation.rb +136 -0
- data/lib/ballast/operations_chain.rb +38 -0
- data/lib/ballast/version.rb +24 -0
- data/lib/ballast.rb +24 -0
- data/spec/ballast/concerns/ajax_spec.rb +124 -0
- data/spec/ballast/concerns/common_spec.rb +100 -0
- data/spec/ballast/concerns/errors_handling_spec.rb +63 -0
- data/spec/ballast/concerns/view_spec.rb +107 -0
- data/spec/ballast/context_spec.rb +23 -0
- data/spec/ballast/errors_spec.rb +16 -0
- data/spec/ballast/operation_spec.rb +175 -0
- data/spec/ballast/operations_chain_spec.rb +33 -0
- data/spec/coverage_helper.rb +19 -0
- data/spec/spec_helper.rb +19 -0
- metadata +225 -0
@@ -0,0 +1,664 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Ballast::Concerns::View
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (V)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Ballast.html" title="Ballast (module)">Ballast</a></span></span> » <span class='title'><span class='object_link'><a href="../Concerns.html" title="Ballast::Concerns (module)">Concerns</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">View</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Ballast::Concerns::View
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/ballast/concerns/view.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
88
|
+
<div class="discussion">
|
89
|
+
<p>A concern to help view handling.</p>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div class="tags">
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<h2>
|
106
|
+
Instance Method Summary
|
107
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
108
|
+
</h2>
|
109
|
+
|
110
|
+
<ul class="summary">
|
111
|
+
|
112
|
+
<li class="public ">
|
113
|
+
<span class="summary_signature">
|
114
|
+
|
115
|
+
<a href="#add_javascript_params-instance_method" title="#add_javascript_params (instance method)">- (Object) <strong>add_javascript_params</strong>(key, data, replace = false) </a>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
</span>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<span class="summary_desc"><div class='inline'><p>Appends new Javascript parameters.</p>
|
130
|
+
</div></span>
|
131
|
+
|
132
|
+
</li>
|
133
|
+
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#browser-instance_method" title="#browser (instance method)">- (Browser) <strong>browser</strong> </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'><p>Returns an instance of the browser.</p>
|
153
|
+
</div></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
157
|
+
|
158
|
+
<li class="public ">
|
159
|
+
<span class="summary_signature">
|
160
|
+
|
161
|
+
<a href="#browser_supported%3F-instance_method" title="#browser_supported? (instance method)">- (Boolean) <strong>browser_supported?</strong>(conf_file = nil) </a>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</span>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the current browser is supported according to a definition YAML file.</p>
|
176
|
+
</div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#javascript_params-instance_method" title="#javascript_params (instance method)">- (String|Hash) <strong>javascript_params</strong>(as_html = true, tag = :details, id = nil) </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="summary_desc"><div class='inline'><p>Outputs the Javascript parameters.</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#scope_css-instance_method" title="#scope_css (instance method)">- (String) <strong>scope_css</strong> </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'><p>Scopes the CSS of the current page using the controller and action name.</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
</ul>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<div id="instance_method_details" class="method_details_list">
|
233
|
+
<h2>Instance Method Details</h2>
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method_details first">
|
237
|
+
<h3 class="signature first" id="add_javascript_params-instance_method">
|
238
|
+
|
239
|
+
- (<tt>Object</tt>) <strong>add_javascript_params</strong>(key, data, replace = false)
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</h3><div class="docstring">
|
246
|
+
<div class="discussion">
|
247
|
+
<p>Appends new Javascript parameters.</p>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
<div class="tags">
|
253
|
+
<p class="tag_title">Parameters:</p>
|
254
|
+
<ul class="param">
|
255
|
+
|
256
|
+
<li>
|
257
|
+
|
258
|
+
<span class='name'>key</span>
|
259
|
+
|
260
|
+
|
261
|
+
<span class='type'>(<tt>String|Symbol</tt>)</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
—
|
266
|
+
<div class='inline'><p>The key of the new parameters. If <code>nil</code>, the root will be merged/replaced.</p>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
</li>
|
270
|
+
|
271
|
+
<li>
|
272
|
+
|
273
|
+
<span class='name'>data</span>
|
274
|
+
|
275
|
+
|
276
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
—
|
281
|
+
<div class='inline'><p>The data to add.</p>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
</li>
|
285
|
+
|
286
|
+
<li>
|
287
|
+
|
288
|
+
<span class='name'>replace</span>
|
289
|
+
|
290
|
+
|
291
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
292
|
+
|
293
|
+
|
294
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
295
|
+
|
296
|
+
|
297
|
+
—
|
298
|
+
<div class='inline'><p>Whether to replace existing data rather than merge.</p>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
</li>
|
302
|
+
|
303
|
+
</ul>
|
304
|
+
|
305
|
+
|
306
|
+
</div><table class="source_code">
|
307
|
+
<tr>
|
308
|
+
<td>
|
309
|
+
<pre class="lines">
|
310
|
+
|
311
|
+
|
312
|
+
48
|
313
|
+
49
|
314
|
+
50
|
315
|
+
51
|
316
|
+
52
|
317
|
+
53
|
318
|
+
54
|
319
|
+
55
|
320
|
+
56
|
321
|
+
57
|
322
|
+
58
|
323
|
+
59
|
324
|
+
60</pre>
|
325
|
+
</td>
|
326
|
+
<td>
|
327
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 48</span>
|
328
|
+
|
329
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_javascript_params'>add_javascript_params</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_replace'>replace</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
330
|
+
<span class='ivar'>@javascript_params</span> <span class='op'>||=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
331
|
+
|
332
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span>
|
333
|
+
<span class='ivar'>@javascript_params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_replace'>replace</span>
|
334
|
+
<span class='ivar'>@javascript_params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
335
|
+
<span class='ivar'>@javascript_params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
336
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_replace'>replace</span>
|
337
|
+
<span class='ivar'>@javascript_params</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
|
338
|
+
<span class='kw'>else</span>
|
339
|
+
<span class='ivar'>@javascript_params</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
340
|
+
<span class='kw'>end</span>
|
341
|
+
<span class='kw'>end</span></pre>
|
342
|
+
</td>
|
343
|
+
</tr>
|
344
|
+
</table>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
<div class="method_details ">
|
348
|
+
<h3 class="signature " id="browser-instance_method">
|
349
|
+
|
350
|
+
- (<tt>Browser</tt>) <strong>browser</strong>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
</h3><div class="docstring">
|
357
|
+
<div class="discussion">
|
358
|
+
<p>Returns an instance of the browser.</p>
|
359
|
+
|
360
|
+
|
361
|
+
</div>
|
362
|
+
</div>
|
363
|
+
<div class="tags">
|
364
|
+
|
365
|
+
<p class="tag_title">Returns:</p>
|
366
|
+
<ul class="return">
|
367
|
+
|
368
|
+
<li>
|
369
|
+
|
370
|
+
|
371
|
+
<span class='type'>(<tt>Browser</tt>)</span>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
—
|
376
|
+
<div class='inline'><p>A browser object.</p>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
</li>
|
380
|
+
|
381
|
+
</ul>
|
382
|
+
|
383
|
+
</div><table class="source_code">
|
384
|
+
<tr>
|
385
|
+
<td>
|
386
|
+
<pre class="lines">
|
387
|
+
|
388
|
+
|
389
|
+
20
|
390
|
+
21
|
391
|
+
22</pre>
|
392
|
+
</td>
|
393
|
+
<td>
|
394
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 20</span>
|
395
|
+
|
396
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_browser'>browser</span>
|
397
|
+
<span class='ivar'>@browser</span> <span class='op'>||=</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_user_agent'>user_agent</span><span class='rparen'>)</span>
|
398
|
+
<span class='kw'>end</span></pre>
|
399
|
+
</td>
|
400
|
+
</tr>
|
401
|
+
</table>
|
402
|
+
</div>
|
403
|
+
|
404
|
+
<div class="method_details ">
|
405
|
+
<h3 class="signature " id="browser_supported?-instance_method">
|
406
|
+
|
407
|
+
- (<tt>Boolean</tt>) <strong>browser_supported?</strong>(conf_file = nil)
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
</h3><div class="docstring">
|
414
|
+
<div class="discussion">
|
415
|
+
<p>Checks if the current browser is supported according to a definition YAML file.</p>
|
416
|
+
|
417
|
+
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
<div class="tags">
|
421
|
+
<p class="tag_title">Parameters:</p>
|
422
|
+
<ul class="param">
|
423
|
+
|
424
|
+
<li>
|
425
|
+
|
426
|
+
<span class='name'>conf_file</span>
|
427
|
+
|
428
|
+
|
429
|
+
<span class='type'>(<tt>String</tt>)</span>
|
430
|
+
|
431
|
+
|
432
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
433
|
+
|
434
|
+
|
435
|
+
—
|
436
|
+
<div class='inline'><p>The configuration file which holds the definitions.</p>
|
437
|
+
</div>
|
438
|
+
|
439
|
+
</li>
|
440
|
+
|
441
|
+
</ul>
|
442
|
+
|
443
|
+
<p class="tag_title">Returns:</p>
|
444
|
+
<ul class="return">
|
445
|
+
|
446
|
+
<li>
|
447
|
+
|
448
|
+
|
449
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
—
|
454
|
+
<div class='inline'><p><code>true</code> if the browser is supported, <code>false</code> otherwise.</p>
|
455
|
+
</div>
|
456
|
+
|
457
|
+
</li>
|
458
|
+
|
459
|
+
</ul>
|
460
|
+
|
461
|
+
</div><table class="source_code">
|
462
|
+
<tr>
|
463
|
+
<td>
|
464
|
+
<pre class="lines">
|
465
|
+
|
466
|
+
|
467
|
+
28
|
468
|
+
29
|
469
|
+
30
|
470
|
+
31</pre>
|
471
|
+
</td>
|
472
|
+
<td>
|
473
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 28</span>
|
474
|
+
|
475
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_browser_supported?'>browser_supported?</span><span class='lparen'>(</span><span class='id identifier rubyid_conf_file'>conf_file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
476
|
+
<span class='id identifier rubyid_conf_file'>conf_file</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>config/supported-browsers.yml</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span>
|
477
|
+
<span class='id identifier rubyid_browser'>browser</span><span class='period'>.</span><span class='id identifier rubyid_supported?'>supported?</span><span class='lparen'>(</span><span class='id identifier rubyid_conf_file'>conf_file</span><span class='rparen'>)</span>
|
478
|
+
<span class='kw'>end</span></pre>
|
479
|
+
</td>
|
480
|
+
</tr>
|
481
|
+
</table>
|
482
|
+
</div>
|
483
|
+
|
484
|
+
<div class="method_details ">
|
485
|
+
<h3 class="signature " id="javascript_params-instance_method">
|
486
|
+
|
487
|
+
- (<tt>String|Hash</tt>) <strong>javascript_params</strong>(as_html = true, tag = :details, id = nil)
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
</h3><div class="docstring">
|
494
|
+
<div class="discussion">
|
495
|
+
<p>Outputs the Javascript parameters.</p>
|
496
|
+
|
497
|
+
|
498
|
+
</div>
|
499
|
+
</div>
|
500
|
+
<div class="tags">
|
501
|
+
<p class="tag_title">Parameters:</p>
|
502
|
+
<ul class="param">
|
503
|
+
|
504
|
+
<li>
|
505
|
+
|
506
|
+
<span class='name'>as_html</span>
|
507
|
+
|
508
|
+
|
509
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
510
|
+
|
511
|
+
|
512
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
513
|
+
|
514
|
+
|
515
|
+
—
|
516
|
+
<div class='inline'><p>Whether to return the parameters as HTML rather than hash.</p>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
</li>
|
520
|
+
|
521
|
+
<li>
|
522
|
+
|
523
|
+
<span class='name'>tag</span>
|
524
|
+
|
525
|
+
|
526
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
527
|
+
|
528
|
+
|
529
|
+
<em class="default">(defaults to: <tt>:details</tt>)</em>
|
530
|
+
|
531
|
+
|
532
|
+
—
|
533
|
+
<div class='inline'><p>The tag to use for HTML.</p>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
</li>
|
537
|
+
|
538
|
+
<li>
|
539
|
+
|
540
|
+
<span class='name'>id</span>
|
541
|
+
|
542
|
+
|
543
|
+
<span class='type'>(<tt>String</tt>)</span>
|
544
|
+
|
545
|
+
|
546
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
547
|
+
|
548
|
+
|
549
|
+
—
|
550
|
+
<div class='inline'><p>The id for the tag.</p>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
</li>
|
554
|
+
|
555
|
+
</ul>
|
556
|
+
|
557
|
+
<p class="tag_title">Returns:</p>
|
558
|
+
<ul class="return">
|
559
|
+
|
560
|
+
<li>
|
561
|
+
|
562
|
+
|
563
|
+
<span class='type'>(<tt>String|Hash</tt>)</span>
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
—
|
568
|
+
<div class='inline'><p>Javascript parameters as HTML or the hash.</p>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
</li>
|
572
|
+
|
573
|
+
</ul>
|
574
|
+
|
575
|
+
</div><table class="source_code">
|
576
|
+
<tr>
|
577
|
+
<td>
|
578
|
+
<pre class="lines">
|
579
|
+
|
580
|
+
|
581
|
+
39
|
582
|
+
40
|
583
|
+
41</pre>
|
584
|
+
</td>
|
585
|
+
<td>
|
586
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 39</span>
|
587
|
+
|
588
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_javascript_params'>javascript_params</span><span class='lparen'>(</span><span class='id identifier rubyid_as_html'>as_html</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_tag'>tag</span> <span class='op'>=</span> <span class='symbol'>:details</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
589
|
+
<span class='id identifier rubyid_as_html'>as_html</span> <span class='op'>?</span> <span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='comma'>,</span> <span class='ivar'>@javascript_params</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='period'>.</span><span class='id identifier rubyid_html_safe'>html_safe</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>data-jid</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='op'>:</span> <span class='ivar'>@javascript_params</span>
|
590
|
+
<span class='kw'>end</span></pre>
|
591
|
+
</td>
|
592
|
+
</tr>
|
593
|
+
</table>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
<div class="method_details ">
|
597
|
+
<h3 class="signature " id="scope_css-instance_method">
|
598
|
+
|
599
|
+
- (<tt>String</tt>) <strong>scope_css</strong>
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</h3><div class="docstring">
|
606
|
+
<div class="discussion">
|
607
|
+
<p>Scopes the CSS of the current page using the controller and action name.</p>
|
608
|
+
|
609
|
+
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
<div class="tags">
|
613
|
+
|
614
|
+
<p class="tag_title">Returns:</p>
|
615
|
+
<ul class="return">
|
616
|
+
|
617
|
+
<li>
|
618
|
+
|
619
|
+
|
620
|
+
<span class='type'>(<tt>String</tt>)</span>
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
—
|
625
|
+
<div class='inline'><p>The scoped string.</p>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
</li>
|
629
|
+
|
630
|
+
</ul>
|
631
|
+
|
632
|
+
</div><table class="source_code">
|
633
|
+
<tr>
|
634
|
+
<td>
|
635
|
+
<pre class="lines">
|
636
|
+
|
637
|
+
|
638
|
+
13
|
639
|
+
14
|
640
|
+
15</pre>
|
641
|
+
</td>
|
642
|
+
<td>
|
643
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 13</span>
|
644
|
+
|
645
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scope_css'>scope_css</span>
|
646
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%s %s</span><span class='tstring_end'>"</span></span> <span class='op'>%</span> <span class='lbracket'>[</span><span class='id identifier rubyid_controller_path'>controller_path</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_action_name'>action_name</span><span class='rbracket'>]</span>
|
647
|
+
<span class='kw'>end</span></pre>
|
648
|
+
</td>
|
649
|
+
</tr>
|
650
|
+
</table>
|
651
|
+
</div>
|
652
|
+
|
653
|
+
</div>
|
654
|
+
|
655
|
+
</div>
|
656
|
+
|
657
|
+
<div id="footer">
|
658
|
+
Generated on Wed Dec 25 11:35:22 2013 by
|
659
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
660
|
+
0.8.7.3 (ruby-2.0.0).
|
661
|
+
</div>
|
662
|
+
|
663
|
+
</body>
|
664
|
+
</html>
|