netlinx-erb 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/doc/Array.html +213 -0
- data/doc/Hash.html +266 -0
- data/doc/HashHelpers.html +413 -0
- data/doc/Helpers.html +2154 -0
- data/doc/NetLinx.html +128 -0
- data/doc/NetLinx/ERB.html +233 -0
- data/doc/NetLinx/ERB/HashHelpers.html +413 -0
- data/doc/NetLinx/ERB/Helpers.html +2157 -0
- data/doc/NetLinx/Rake.html +117 -0
- data/doc/NetLinx/Rake/ERB.html +117 -0
- data/doc/NetLinx/Rake/ERB/Compile.html +354 -0
- data/doc/NetLinx/Rake/ERB/GenerateERB.html +419 -0
- data/doc/NetLinx/Rake/ERB/GenerateRPC.html +349 -0
- data/doc/NetLinx/Rake/ERB/Lines.html +381 -0
- data/doc/NetLinx/Rake/Lines.html +381 -0
- data/doc/RPC.html +683 -0
- data/doc/String.html +322 -0
- data/doc/_index.html +248 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +84 -0
- data/doc/file.license.html +73 -0
- data/doc/file_list.html +63 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +84 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +237 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/netlinx-erb.rb +14 -0
- data/lib/netlinx/erb/erb.rb +19 -0
- data/lib/netlinx/erb/hash_helpers.rb +42 -0
- data/lib/netlinx/erb/helpers.rb +399 -0
- data/lib/netlinx/erb/rpc.rb +270 -0
- data/lib/netlinx/rake/erb.rb +26 -0
- data/lib/netlinx/rake/erb/generate_erb.rb +66 -0
- data/lib/netlinx/rake/erb/generate_rpc.rb +31 -0
- data/lib/netlinx/rake/erb/lines.rb +47 -0
- data/license.txt +21 -0
- data/template/Gemfile +9 -0
- data/template/README.md +130 -0
- data/template/Rakefile +11 -0
- data/template/rpc.axi +148 -0
- metadata +234 -0
@@ -0,0 +1,413 @@
|
|
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: HashHelpers
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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#!HashHelpers.html";
|
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 (H)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">HashHelpers</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: HashHelpers
|
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/netlinx/erb/hash_helpers.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
88
|
+
<div class="discussion">
|
89
|
+
|
90
|
+
<p>A collection of helper methods for use in Hash</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>
|
107
|
+
Instance Method Summary
|
108
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
109
|
+
</h2>
|
110
|
+
|
111
|
+
<ul class="summary">
|
112
|
+
|
113
|
+
<li class="public ">
|
114
|
+
<span class="summary_signature">
|
115
|
+
|
116
|
+
<a href="#append_suffix-instance_method" title="#append_suffix (instance method)">- (Object) <strong>append_suffix</strong> </a>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</span>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<span class="summary_desc"><div class='inline'>
|
131
|
+
<p>Append the @tmpl_suffix to each key in the hash.</p>
|
132
|
+
</div></span>
|
133
|
+
|
134
|
+
</li>
|
135
|
+
|
136
|
+
|
137
|
+
<li class="public ">
|
138
|
+
<span class="summary_signature">
|
139
|
+
|
140
|
+
<a href="#append_suffix%21-instance_method" title="#append_suffix! (instance method)">- (Object) <strong>append_suffix!</strong> </a>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'>
|
155
|
+
<p>Append the @tmpl_suffix to each key in the hash and overwrite this hash
|
156
|
+
with the result.</p>
|
157
|
+
</div></span>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
<li class="public ">
|
163
|
+
<span class="summary_signature">
|
164
|
+
|
165
|
+
<a href="#tmpl_suffix-instance_method" title="#tmpl_suffix (instance method)">- (Object) <strong>tmpl_suffix</strong> </a>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'>
|
180
|
+
<p>Template suffix (capitalized / unmodified).</p>
|
181
|
+
</div></span>
|
182
|
+
|
183
|
+
</li>
|
184
|
+
|
185
|
+
|
186
|
+
<li class="public ">
|
187
|
+
<span class="summary_signature">
|
188
|
+
|
189
|
+
<a href="#tmpl_var_suffix-instance_method" title="#tmpl_var_suffix (instance method)">- (Object) <strong>tmpl_var_suffix</strong> </a>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</span>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<span class="summary_desc"><div class='inline'>
|
204
|
+
<p>Template suffix for variables (lowercase).</p>
|
205
|
+
</div></span>
|
206
|
+
|
207
|
+
</li>
|
208
|
+
|
209
|
+
|
210
|
+
</ul>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<div id="instance_method_details" class="method_details_list">
|
216
|
+
<h2>Instance Method Details</h2>
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method_details first">
|
220
|
+
<h3 class="signature first" id="append_suffix-instance_method">
|
221
|
+
|
222
|
+
- (<tt>Object</tt>) <strong>append_suffix</strong>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
</h3><div class="docstring">
|
229
|
+
<div class="discussion">
|
230
|
+
|
231
|
+
<p>Append the @tmpl_suffix to each key in the hash.</p>
|
232
|
+
|
233
|
+
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
<div class="tags">
|
237
|
+
|
238
|
+
|
239
|
+
</div><table class="source_code">
|
240
|
+
<tr>
|
241
|
+
<td>
|
242
|
+
<pre class="lines">
|
243
|
+
|
244
|
+
|
245
|
+
19
|
246
|
+
20
|
247
|
+
21
|
248
|
+
22
|
249
|
+
23
|
250
|
+
24
|
251
|
+
25
|
252
|
+
26
|
253
|
+
27
|
254
|
+
28</pre>
|
255
|
+
</td>
|
256
|
+
<td>
|
257
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/hash_helpers.rb', line 19</span>
|
258
|
+
|
259
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_append_suffix'>append_suffix</span>
|
260
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
261
|
+
<span class='id identifier rubyid_key_name'>key_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
262
|
+
<span class='id identifier rubyid_key_name'>key_name</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tmpl_suffix'>tmpl_suffix</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_tmpl_suffix'>tmpl_suffix</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='id identifier rubyid_tmpl_suffix'>tmpl_suffix</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
263
|
+
|
264
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_key_name'>key_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span>
|
265
|
+
<span class='kw'>end</span>
|
266
|
+
|
267
|
+
<span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_hash'>hash</span><span class='rbracket'>]</span>
|
268
|
+
<span class='kw'>end</span></pre>
|
269
|
+
</td>
|
270
|
+
</tr>
|
271
|
+
</table>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div class="method_details ">
|
275
|
+
<h3 class="signature " id="append_suffix!-instance_method">
|
276
|
+
|
277
|
+
- (<tt>Object</tt>) <strong>append_suffix!</strong>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</h3><div class="docstring">
|
284
|
+
<div class="discussion">
|
285
|
+
|
286
|
+
<p>Append the @tmpl_suffix to each key in the hash and overwrite this hash
|
287
|
+
with the result.</p>
|
288
|
+
|
289
|
+
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
<div class="tags">
|
293
|
+
|
294
|
+
|
295
|
+
</div><table class="source_code">
|
296
|
+
<tr>
|
297
|
+
<td>
|
298
|
+
<pre class="lines">
|
299
|
+
|
300
|
+
|
301
|
+
32
|
302
|
+
33
|
303
|
+
34
|
304
|
+
35
|
305
|
+
36</pre>
|
306
|
+
</td>
|
307
|
+
<td>
|
308
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/hash_helpers.rb', line 32</span>
|
309
|
+
|
310
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_append_suffix!'>append_suffix!</span>
|
311
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_append_suffix'>append_suffix</span>
|
312
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
313
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span> <span class='id identifier rubyid_hash'>hash</span>
|
314
|
+
<span class='kw'>end</span></pre>
|
315
|
+
</td>
|
316
|
+
</tr>
|
317
|
+
</table>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method_details ">
|
321
|
+
<h3 class="signature " id="tmpl_suffix-instance_method">
|
322
|
+
|
323
|
+
- (<tt>Object</tt>) <strong>tmpl_suffix</strong>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</h3><div class="docstring">
|
330
|
+
<div class="discussion">
|
331
|
+
|
332
|
+
<p>Template suffix (capitalized / unmodified).</p>
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
</div>
|
337
|
+
<div class="tags">
|
338
|
+
|
339
|
+
|
340
|
+
</div><table class="source_code">
|
341
|
+
<tr>
|
342
|
+
<td>
|
343
|
+
<pre class="lines">
|
344
|
+
|
345
|
+
|
346
|
+
9
|
347
|
+
10
|
348
|
+
11</pre>
|
349
|
+
</td>
|
350
|
+
<td>
|
351
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/hash_helpers.rb', line 9</span>
|
352
|
+
|
353
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tmpl_suffix'>tmpl_suffix</span>
|
354
|
+
<span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span> <span class='symbol'>:@tmpl_suffix</span>
|
355
|
+
<span class='kw'>end</span></pre>
|
356
|
+
</td>
|
357
|
+
</tr>
|
358
|
+
</table>
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<div class="method_details ">
|
362
|
+
<h3 class="signature " id="tmpl_var_suffix-instance_method">
|
363
|
+
|
364
|
+
- (<tt>Object</tt>) <strong>tmpl_var_suffix</strong>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
</h3><div class="docstring">
|
371
|
+
<div class="discussion">
|
372
|
+
|
373
|
+
<p>Template suffix for variables (lowercase).</p>
|
374
|
+
|
375
|
+
|
376
|
+
</div>
|
377
|
+
</div>
|
378
|
+
<div class="tags">
|
379
|
+
|
380
|
+
|
381
|
+
</div><table class="source_code">
|
382
|
+
<tr>
|
383
|
+
<td>
|
384
|
+
<pre class="lines">
|
385
|
+
|
386
|
+
|
387
|
+
14
|
388
|
+
15
|
389
|
+
16</pre>
|
390
|
+
</td>
|
391
|
+
<td>
|
392
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/hash_helpers.rb', line 14</span>
|
393
|
+
|
394
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tmpl_var_suffix'>tmpl_var_suffix</span>
|
395
|
+
<span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span> <span class='symbol'>:@tmpl_var_suffix</span>
|
396
|
+
<span class='kw'>end</span></pre>
|
397
|
+
</td>
|
398
|
+
</tr>
|
399
|
+
</table>
|
400
|
+
</div>
|
401
|
+
|
402
|
+
</div>
|
403
|
+
|
404
|
+
</div>
|
405
|
+
|
406
|
+
<div id="footer">
|
407
|
+
Generated on Fri Jan 30 11:09:15 2015 by
|
408
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
409
|
+
0.8.7.6 (ruby-2.1.3).
|
410
|
+
</div>
|
411
|
+
|
412
|
+
</body>
|
413
|
+
</html>
|
data/doc/Helpers.html
ADDED
@@ -0,0 +1,2154 @@
|
|
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: Helpers
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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#!Helpers.html";
|
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 (H)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Helpers</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: Helpers
|
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/netlinx/erb/helpers.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
88
|
+
<div class="discussion">
|
89
|
+
|
90
|
+
<p>A collection of helper methods for use in NetLinx ERB files.</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<h2>
|
107
|
+
Formatting
|
108
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
109
|
+
</h2>
|
110
|
+
|
111
|
+
<ul class="summary">
|
112
|
+
|
113
|
+
<li class="public ">
|
114
|
+
<span class="summary_signature">
|
115
|
+
|
116
|
+
<a href="#group-instance_method" title="#group (instance method)">- (String) <strong>group</strong>(hash, padding: nil) {|key, value| ... }</a>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</span>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<span class="summary_desc"><div class='inline'>
|
131
|
+
<p>Generate a group of lines for a given hash.</p>
|
132
|
+
</div></span>
|
133
|
+
|
134
|
+
</li>
|
135
|
+
|
136
|
+
|
137
|
+
<li class="public ">
|
138
|
+
<span class="summary_signature">
|
139
|
+
|
140
|
+
<a href="#justify-instance_method" title="#justify (instance method)">- (String) <strong>justify</strong>(str, amount: nil, type: nil) </a>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'>
|
155
|
+
<p>Left justify a block of code to line up on a type of character.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
<h2>
|
164
|
+
Code Generation
|
165
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
166
|
+
</h2>
|
167
|
+
|
168
|
+
<ul class="summary">
|
169
|
+
|
170
|
+
<li class="public ">
|
171
|
+
<span class="summary_signature">
|
172
|
+
|
173
|
+
<a href="#auto_comment-instance_method" title="#auto_comment (instance method)">- (String) <strong>auto_comment</strong>(str, condition) </a>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
</span>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'>
|
188
|
+
<p>Automatically comment out the input unless the condition is met.</p>
|
189
|
+
</div></span>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
|
194
|
+
<li class="public ">
|
195
|
+
<span class="summary_signature">
|
196
|
+
|
197
|
+
<a href="#button_event-instance_method" title="#button_event (instance method)">- (String) <strong>button_event</strong>(buttons, device = @dvTP) </a>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</span>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<span class="summary_desc"><div class='inline'>
|
212
|
+
<p>Generate button events for the given hash of buttons.</p>
|
213
|
+
</div></span>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
<li class="public ">
|
219
|
+
<span class="summary_signature">
|
220
|
+
|
221
|
+
<a href="#button_event_block-instance_method" title="#button_event_block (instance method)">- (Object) <strong>button_event_block</strong>(buttons, **kwargs) {|value, name| ... }</a>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</span>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<span class="summary_desc"><div class='inline'>
|
236
|
+
<p>Generate a button_event block for the given hash of buttons.</p>
|
237
|
+
</div></span>
|
238
|
+
|
239
|
+
</li>
|
240
|
+
|
241
|
+
|
242
|
+
<li class="public ">
|
243
|
+
<span class="summary_signature">
|
244
|
+
|
245
|
+
<a href="#execute_erb-instance_method" title="#execute_erb (instance method)">- (String) <strong>execute_erb</strong>(template_file) </a>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</span>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<span class="summary_desc"><div class='inline'>
|
260
|
+
<p>Run ERB on the given template file.</p>
|
261
|
+
</div></span>
|
262
|
+
|
263
|
+
</li>
|
264
|
+
|
265
|
+
|
266
|
+
<li class="public ">
|
267
|
+
<span class="summary_signature">
|
268
|
+
|
269
|
+
<a href="#generate_constant_ivars-instance_method" title="#generate_constant_ivars (instance method)">- (Object) <strong>generate_constant_ivars</strong>(h, append_suffix: false) </a>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'>
|
284
|
+
<p>Generate instance variables for the DEFINE_CONSTANTS section from the given
|
285
|
+
hash keys.</p>
|
286
|
+
</div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#generate_variable_ivars-instance_method" title="#generate_variable_ivars (instance method)">- (Object) <strong>generate_variable_ivars</strong>(h, append_suffix: true) </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>Generate instance variables for the DEFINE_VARIABLES section from the given
|
310
|
+
hash keys.</p>
|
311
|
+
</div></span>
|
312
|
+
|
313
|
+
</li>
|
314
|
+
|
315
|
+
|
316
|
+
<li class="public ">
|
317
|
+
<span class="summary_signature">
|
318
|
+
|
319
|
+
<a href="#hiqnet_empty-instance_method" title="#hiqnet_empty (instance method)">- (Object) <strong>hiqnet_empty</strong> </a>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
</span>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
<span class="summary_desc"><div class='inline'>
|
334
|
+
<p>Generate an empty HiQnet address string.</p>
|
335
|
+
</div></span>
|
336
|
+
|
337
|
+
</li>
|
338
|
+
|
339
|
+
|
340
|
+
<li class="public ">
|
341
|
+
<span class="summary_signature">
|
342
|
+
|
343
|
+
<a href="#print_constant_hash-instance_method" title="#print_constant_hash (instance method)">- (String) <strong>print_constant_hash</strong>(h, justify: nil) </a>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
</span>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
<span class="summary_desc"><div class='inline'>
|
358
|
+
<p>Print the list of constants.</p>
|
359
|
+
</div></span>
|
360
|
+
|
361
|
+
</li>
|
362
|
+
|
363
|
+
|
364
|
+
<li class="public ">
|
365
|
+
<span class="summary_signature">
|
366
|
+
|
367
|
+
<a href="#print_device_hash-instance_method" title="#print_device_hash (instance method)">- (String) <strong>print_device_hash</strong>(h, justify: nil) </a>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
</span>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
<span class="summary_desc"><div class='inline'>
|
382
|
+
<p>Print the list of devices.</p>
|
383
|
+
</div></span>
|
384
|
+
|
385
|
+
</li>
|
386
|
+
|
387
|
+
|
388
|
+
<li class="public ">
|
389
|
+
<span class="summary_signature">
|
390
|
+
|
391
|
+
<a href="#print_variable_hash-instance_method" title="#print_variable_hash (instance method)">- (String) <strong>print_variable_hash</strong>(h) </a>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</span>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<span class="summary_desc"><div class='inline'>
|
406
|
+
<p>Print the list of variables.</p>
|
407
|
+
</div></span>
|
408
|
+
|
409
|
+
</li>
|
410
|
+
|
411
|
+
|
412
|
+
<li class="public ">
|
413
|
+
<span class="summary_signature">
|
414
|
+
|
415
|
+
<a href="#show_control-instance_method" title="#show_control (instance method)">- (Object) <strong>show_control</strong>(control, show, device: @dvTP) </a>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
</span>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
<span class="summary_desc"><div class='inline'>
|
430
|
+
<p>Send a touch panel command to show or hide a control.</p>
|
431
|
+
</div></span>
|
432
|
+
|
433
|
+
</li>
|
434
|
+
|
435
|
+
|
436
|
+
</ul>
|
437
|
+
|
438
|
+
<h2>
|
439
|
+
Other
|
440
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
441
|
+
</h2>
|
442
|
+
|
443
|
+
<ul class="summary">
|
444
|
+
|
445
|
+
<li class="public ">
|
446
|
+
<span class="summary_signature">
|
447
|
+
|
448
|
+
<a href="#check_for_duplicate_values-instance_method" title="#check_for_duplicate_values (instance method)">- (Object) <strong>check_for_duplicate_values</strong>(*hashes) </a>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
</span>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
<span class="summary_desc"><div class='inline'>
|
463
|
+
<p>Ensures button number constants haven't been unintentionally
|
464
|
+
duplicated.</p>
|
465
|
+
</div></span>
|
466
|
+
|
467
|
+
</li>
|
468
|
+
|
469
|
+
|
470
|
+
</ul>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<div id="instance_method_details" class="method_details_list">
|
476
|
+
<h2>Instance Method Details</h2>
|
477
|
+
|
478
|
+
|
479
|
+
<div class="method_details first">
|
480
|
+
<h3 class="signature first" id="auto_comment-instance_method">
|
481
|
+
|
482
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>auto_comment</strong>(str, condition)
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
</h3><div class="docstring">
|
489
|
+
<div class="discussion">
|
490
|
+
|
491
|
+
<p>Automatically comment out the input unless the condition is met.</p>
|
492
|
+
|
493
|
+
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
<div class="tags">
|
497
|
+
<p class="tag_title">Parameters:</p>
|
498
|
+
<ul class="param">
|
499
|
+
|
500
|
+
<li>
|
501
|
+
|
502
|
+
<span class='name'>str</span>
|
503
|
+
|
504
|
+
|
505
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
—
|
510
|
+
<div class='inline'>
|
511
|
+
<p>NetLinx source code string</p>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
</li>
|
515
|
+
|
516
|
+
<li>
|
517
|
+
|
518
|
+
<span class='name'>condition</span>
|
519
|
+
|
520
|
+
|
521
|
+
<span class='type'></span>
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
—
|
526
|
+
<div class='inline'>
|
527
|
+
<p>comments out the source code string if evaluates to false or nil</p>
|
528
|
+
</div>
|
529
|
+
|
530
|
+
</li>
|
531
|
+
|
532
|
+
</ul>
|
533
|
+
|
534
|
+
<p class="tag_title">Returns:</p>
|
535
|
+
<ul class="return">
|
536
|
+
|
537
|
+
<li>
|
538
|
+
|
539
|
+
|
540
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
—
|
545
|
+
<div class='inline'>
|
546
|
+
<p>NetLinx source code</p>
|
547
|
+
</div>
|
548
|
+
|
549
|
+
</li>
|
550
|
+
|
551
|
+
</ul>
|
552
|
+
|
553
|
+
</div><table class="source_code">
|
554
|
+
<tr>
|
555
|
+
<td>
|
556
|
+
<pre class="lines">
|
557
|
+
|
558
|
+
|
559
|
+
160
|
560
|
+
161
|
561
|
+
162</pre>
|
562
|
+
</td>
|
563
|
+
<td>
|
564
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 160</span>
|
565
|
+
|
566
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_auto_comment'>auto_comment</span> <span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='id identifier rubyid_condition'>condition</span>
|
567
|
+
<span class='id identifier rubyid_condition'>condition</span> <span class='op'>?</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>:</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>// </span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id identifier rubyid_line'>line</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
568
|
+
<span class='kw'>end</span></pre>
|
569
|
+
</td>
|
570
|
+
</tr>
|
571
|
+
</table>
|
572
|
+
</div>
|
573
|
+
|
574
|
+
<div class="method_details ">
|
575
|
+
<h3 class="signature " id="button_event-instance_method">
|
576
|
+
|
577
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>button_event</strong>(buttons, device = @dvTP)
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
</h3><div class="docstring">
|
584
|
+
<div class="discussion">
|
585
|
+
|
586
|
+
<p>Generate button events for the given hash of buttons.</p>
|
587
|
+
|
588
|
+
|
589
|
+
</div>
|
590
|
+
</div>
|
591
|
+
<div class="tags">
|
592
|
+
<p class="tag_title">Parameters:</p>
|
593
|
+
<ul class="param">
|
594
|
+
|
595
|
+
<li>
|
596
|
+
|
597
|
+
<span class='name'>buttons</span>
|
598
|
+
|
599
|
+
|
600
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
—
|
605
|
+
<div class='inline'>
|
606
|
+
<p>button constants</p>
|
607
|
+
</div>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
<li>
|
612
|
+
|
613
|
+
<span class='name'>device</span>
|
614
|
+
|
615
|
+
|
616
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
617
|
+
|
618
|
+
|
619
|
+
<em class="default">(defaults to: <tt>@dvTP</tt>)</em>
|
620
|
+
|
621
|
+
|
622
|
+
—
|
623
|
+
<div class='inline'>
|
624
|
+
<p>touch panel device constant. @dvTP comes from ERB template.</p>
|
625
|
+
</div>
|
626
|
+
|
627
|
+
</li>
|
628
|
+
|
629
|
+
</ul>
|
630
|
+
|
631
|
+
<p class="tag_title">Returns:</p>
|
632
|
+
<ul class="return">
|
633
|
+
|
634
|
+
<li>
|
635
|
+
|
636
|
+
|
637
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
—
|
642
|
+
<div class='inline'>
|
643
|
+
<p>[dev, chan] source code</p>
|
644
|
+
</div>
|
645
|
+
|
646
|
+
</li>
|
647
|
+
|
648
|
+
</ul>
|
649
|
+
|
650
|
+
</div><table class="source_code">
|
651
|
+
<tr>
|
652
|
+
<td>
|
653
|
+
<pre class="lines">
|
654
|
+
|
655
|
+
|
656
|
+
169
|
657
|
+
170
|
658
|
+
171</pre>
|
659
|
+
</td>
|
660
|
+
<td>
|
661
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 169</span>
|
662
|
+
|
663
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_button_event'>button_event</span> <span class='id identifier rubyid_buttons'>buttons</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span> <span class='op'>=</span> <span class='ivar'>@dvTP</span>
|
664
|
+
<span class='id identifier rubyid_buttons'>buttons</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>button_event[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_device'>device</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
665
|
+
<span class='kw'>end</span></pre>
|
666
|
+
</td>
|
667
|
+
</tr>
|
668
|
+
</table>
|
669
|
+
</div>
|
670
|
+
|
671
|
+
<div class="method_details ">
|
672
|
+
<h3 class="signature " id="button_event_block-instance_method">
|
673
|
+
|
674
|
+
- (<tt>Object</tt>) <strong>button_event_block</strong>(buttons, **kwargs) {|value, name| ... }
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
</h3><div class="docstring">
|
681
|
+
<div class="discussion">
|
682
|
+
|
683
|
+
<p>Generate a button_event block for the given hash of buttons.</p>
|
684
|
+
|
685
|
+
|
686
|
+
</div>
|
687
|
+
</div>
|
688
|
+
<div class="tags">
|
689
|
+
|
690
|
+
<div class="examples">
|
691
|
+
<p class="tag_title">Examples:</p>
|
692
|
+
|
693
|
+
|
694
|
+
<pre class="example code"><code><span class='id identifier rubyid_button_event_block'>button_event_block</span> <span class='id identifier rubyid_bluray_key_constants'>bluray_key_constants</span><span class='period'>.</span><span class='id identifier rubyid_remap'>remap</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='rparen'>)</span><span class='comma'>,</span>
|
695
|
+
<span class='label'>function:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bluray_key</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>momentary:</span> <span class='kw'>true</span>
|
696
|
+
|
697
|
+
<span class='id identifier rubyid_button_event_block'>button_event_block</span> <span class='id identifier rubyid_channel_strip_constants'>channel_strip_constants</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_end_with?'>end_with?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_UP</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='comma'>,</span>
|
698
|
+
<span class='label'>function:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>audio_increment_volume</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>remap:</span> <span class='symbol'>:audio</span><span class='comma'>,</span> <span class='label'>hold_block:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>momentary:</span> <span class='kw'>true</span>
|
699
|
+
|
700
|
+
<span class='comment'># Use block to create function string.
|
701
|
+
</span><span class='comment'># :function not set
|
702
|
+
</span><span class='id identifier rubyid_button_event_block'>button_event_block</span><span class='lparen'>(</span><span class='id identifier rubyid_video_source_constants'>video_source_constants</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span>
|
703
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>video_patch(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:input</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:dest</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
704
|
+
<span class='rbrace'>}</span>
|
705
|
+
|
706
|
+
<span class='comment'># Use block to create parameters string.
|
707
|
+
</span><span class='comment'># :function is set
|
708
|
+
</span><span class='id identifier rubyid_button_event_block'>button_event_block</span><span class='lparen'>(</span><span class='id identifier rubyid_video_source_constants'>video_source_constants</span><span class='comma'>,</span> <span class='label'>function:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>video_patch</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span>
|
709
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:input</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:dest</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
710
|
+
<span class='rbrace'>}</span>
|
711
|
+
|
712
|
+
<span class='comment'># Use block to specify an array of parameters.
|
713
|
+
</span><span class='comment'># :function is set
|
714
|
+
</span><span class='id identifier rubyid_button_event_block'>button_event_block</span><span class='lparen'>(</span><span class='id identifier rubyid_video_source_constants'>video_source_constants</span><span class='comma'>,</span> <span class='label'>function:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>video_patch</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span>
|
715
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:input</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='symbol'>:dest</span><span class='rbracket'>]</span><span class='rbracket'>]</span>
|
716
|
+
<span class='rbrace'>}</span></code></pre>
|
717
|
+
|
718
|
+
</div>
|
719
|
+
<p class="tag_title">Parameters:</p>
|
720
|
+
<ul class="param">
|
721
|
+
|
722
|
+
<li>
|
723
|
+
|
724
|
+
<span class='name'>buttons</span>
|
725
|
+
|
726
|
+
|
727
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
—
|
732
|
+
<div class='inline'>
|
733
|
+
<p>button constants</p>
|
734
|
+
</div>
|
735
|
+
|
736
|
+
</li>
|
737
|
+
|
738
|
+
<li>
|
739
|
+
|
740
|
+
<span class='name'>kwargs</span>
|
741
|
+
|
742
|
+
|
743
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
</li>
|
748
|
+
|
749
|
+
</ul>
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
<p class="tag_title">Options Hash (<tt>**kwargs</tt>):</p>
|
757
|
+
<ul class="option">
|
758
|
+
|
759
|
+
<li>
|
760
|
+
<span class="name">:function</span>
|
761
|
+
<span class="type">(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
762
|
+
<span class="default">
|
763
|
+
|
764
|
+
</span>
|
765
|
+
|
766
|
+
— <div class='inline'>
|
767
|
+
<p>name of the function to call in the switch block</p>
|
768
|
+
</div>
|
769
|
+
|
770
|
+
</li>
|
771
|
+
|
772
|
+
<li>
|
773
|
+
<span class="name">:remap</span>
|
774
|
+
<span class="type">(<tt>Symbol</tt>, <tt>nil</tt>)</span>
|
775
|
+
<span class="default">
|
776
|
+
|
777
|
+
</span>
|
778
|
+
|
779
|
+
— <div class='inline'>
|
780
|
+
<p>name of symbol to use to <span class='object_link'><a href="Hash.html#remap-instance_method" title="Hash#remap (method)">Hash#remap</a></span> the hash. This is a convenience arg
|
781
|
+
for readability; the hash can also be remapped before passed into this
|
782
|
+
method.</p>
|
783
|
+
</div>
|
784
|
+
|
785
|
+
</li>
|
786
|
+
|
787
|
+
<li>
|
788
|
+
<span class="name">:device</span>
|
789
|
+
<span class="type">(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
790
|
+
<span class="default">
|
791
|
+
|
792
|
+
</span>
|
793
|
+
|
794
|
+
— <div class='inline'>
|
795
|
+
<p>touch panel device constant. @dvTP comes from ERB template.</p>
|
796
|
+
</div>
|
797
|
+
|
798
|
+
</li>
|
799
|
+
|
800
|
+
<li>
|
801
|
+
<span class="name">:padding</span>
|
802
|
+
<span class="type">(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>, <tt>Numeric</tt>)</span>
|
803
|
+
<span class="default">
|
804
|
+
|
805
|
+
— default:
|
806
|
+
<tt>3</tt>
|
807
|
+
|
808
|
+
</span>
|
809
|
+
|
810
|
+
— <div class='inline'>
|
811
|
+
<p>whitespace placed in front of the string. Can be a string of spaces, or a
|
812
|
+
number representing the indentation level.</p>
|
813
|
+
</div>
|
814
|
+
|
815
|
+
</li>
|
816
|
+
|
817
|
+
<li>
|
818
|
+
<span class="name">:momentary</span>
|
819
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
820
|
+
<span class="default">
|
821
|
+
|
822
|
+
— default:
|
823
|
+
<tt>false</tt>
|
824
|
+
|
825
|
+
</span>
|
826
|
+
|
827
|
+
— <div class='inline'>
|
828
|
+
<p>adds a `to` statement for momentary button feedback</p>
|
829
|
+
</div>
|
830
|
+
|
831
|
+
</li>
|
832
|
+
|
833
|
+
<li>
|
834
|
+
<span class="name">:hold_block</span>
|
835
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
836
|
+
<span class="default">
|
837
|
+
|
838
|
+
— default:
|
839
|
+
<tt>false</tt>
|
840
|
+
|
841
|
+
</span>
|
842
|
+
|
843
|
+
— <div class='inline'>
|
844
|
+
<p>create a hold block for the event</p>
|
845
|
+
</div>
|
846
|
+
|
847
|
+
</li>
|
848
|
+
|
849
|
+
<li>
|
850
|
+
<span class="name">:hold_time</span>
|
851
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
852
|
+
<span class="default">
|
853
|
+
|
854
|
+
— default:
|
855
|
+
<tt>0.6</tt>
|
856
|
+
|
857
|
+
</span>
|
858
|
+
|
859
|
+
— <div class='inline'>
|
860
|
+
<p>repeat time for the hold block</p>
|
861
|
+
</div>
|
862
|
+
|
863
|
+
</li>
|
864
|
+
|
865
|
+
</ul>
|
866
|
+
|
867
|
+
|
868
|
+
<p class="tag_title">Yields:</p>
|
869
|
+
<ul class="yield">
|
870
|
+
|
871
|
+
<li>
|
872
|
+
|
873
|
+
|
874
|
+
<span class='type'>(<tt>value</tt>, <tt>name</tt>)</span>
|
875
|
+
|
876
|
+
|
877
|
+
|
878
|
+
—
|
879
|
+
<div class='inline'>
|
880
|
+
<p>option to create a custom function call string. Modifies the function
|
881
|
+
arguments if :function is set, otherwise modifies the entire function call
|
882
|
+
string.</p>
|
883
|
+
</div>
|
884
|
+
|
885
|
+
</li>
|
886
|
+
|
887
|
+
</ul>
|
888
|
+
<p class="tag_title">Yield Parameters:</p>
|
889
|
+
<ul class="yieldparam">
|
890
|
+
|
891
|
+
<li>
|
892
|
+
|
893
|
+
<span class='name'>value</span>
|
894
|
+
|
895
|
+
|
896
|
+
<span class='type'></span>
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
—
|
901
|
+
<div class='inline'>
|
902
|
+
<p>value of the buttons hash for the given key. Accounts for remap.</p>
|
903
|
+
</div>
|
904
|
+
|
905
|
+
</li>
|
906
|
+
|
907
|
+
<li>
|
908
|
+
|
909
|
+
<span class='name'>name</span>
|
910
|
+
|
911
|
+
|
912
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
913
|
+
|
914
|
+
|
915
|
+
|
916
|
+
—
|
917
|
+
<div class='inline'>
|
918
|
+
<p>key of the buttons hash</p>
|
919
|
+
</div>
|
920
|
+
|
921
|
+
</li>
|
922
|
+
|
923
|
+
</ul>
|
924
|
+
<p class="tag_title">Yield Returns:</p>
|
925
|
+
<ul class="yieldreturn">
|
926
|
+
|
927
|
+
<li>
|
928
|
+
|
929
|
+
|
930
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
—
|
935
|
+
<div class='inline'>
|
936
|
+
<p>function string</p>
|
937
|
+
</div>
|
938
|
+
|
939
|
+
</li>
|
940
|
+
|
941
|
+
</ul>
|
942
|
+
|
943
|
+
</div><table class="source_code">
|
944
|
+
<tr>
|
945
|
+
<td>
|
946
|
+
<pre class="lines">
|
947
|
+
|
948
|
+
|
949
|
+
219
|
950
|
+
220
|
951
|
+
221
|
952
|
+
222
|
953
|
+
223
|
954
|
+
224
|
955
|
+
225
|
956
|
+
226
|
957
|
+
227
|
958
|
+
228
|
959
|
+
229
|
960
|
+
230
|
961
|
+
231
|
962
|
+
232
|
963
|
+
233
|
964
|
+
234
|
965
|
+
235
|
966
|
+
236
|
967
|
+
237
|
968
|
+
238
|
969
|
+
239
|
970
|
+
240
|
971
|
+
241
|
972
|
+
242
|
973
|
+
243
|
974
|
+
244
|
975
|
+
245
|
976
|
+
246
|
977
|
+
247
|
978
|
+
248
|
979
|
+
249
|
980
|
+
250
|
981
|
+
251
|
982
|
+
252
|
983
|
+
253
|
984
|
+
254
|
985
|
+
255
|
986
|
+
256
|
987
|
+
257
|
988
|
+
258
|
989
|
+
259
|
990
|
+
260
|
991
|
+
261
|
992
|
+
262
|
993
|
+
263
|
994
|
+
264
|
995
|
+
265
|
996
|
+
266
|
997
|
+
267
|
998
|
+
268
|
999
|
+
269
|
1000
|
+
270
|
1001
|
+
271
|
1002
|
+
272
|
1003
|
+
273
|
1004
|
+
274
|
1005
|
+
275
|
1006
|
+
276
|
1007
|
+
277
|
1008
|
+
278
|
1009
|
+
279
|
1010
|
+
280
|
1011
|
+
281
|
1012
|
+
282</pre>
|
1013
|
+
</td>
|
1014
|
+
<td>
|
1015
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 219</span>
|
1016
|
+
|
1017
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_button_event_block'>button_event_block</span> <span class='id identifier rubyid_buttons'>buttons</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='id identifier rubyid_block'>block</span>
|
1018
|
+
<span class='id identifier rubyid_function'>function</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:function</span><span class='comma'>,</span> <span class='kw'>nil</span>
|
1019
|
+
<span class='id identifier rubyid_device'>device</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:device</span><span class='comma'>,</span> <span class='ivar'>@dvTP</span>
|
1020
|
+
<span class='id identifier rubyid_remap'>remap</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:remap</span><span class='comma'>,</span> <span class='kw'>nil</span>
|
1021
|
+
<span class='id identifier rubyid_padding'>padding</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:padding</span><span class='comma'>,</span> <span class='int'>3</span>
|
1022
|
+
<span class='id identifier rubyid_momentary'>momentary</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:momentary</span><span class='comma'>,</span> <span class='kw'>false</span>
|
1023
|
+
<span class='id identifier rubyid_hold_block'>hold_block</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:hold_block</span><span class='comma'>,</span> <span class='kw'>false</span>
|
1024
|
+
<span class='id identifier rubyid_hold_time'>hold_time</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:hold_time</span><span class='comma'>,</span> <span class='float'>0.6</span>
|
1025
|
+
|
1026
|
+
<span class='id identifier rubyid_buttons'>buttons</span> <span class='op'>=</span> <span class='id identifier rubyid_buttons'>buttons</span><span class='period'>.</span><span class='id identifier rubyid_remap'>remap</span><span class='lparen'>(</span><span class='id identifier rubyid_remap'>remap</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_remap'>remap</span>
|
1027
|
+
|
1028
|
+
<span class='id identifier rubyid_case_string'>case_string</span> <span class='op'>=</span> <span class='id identifier rubyid_justify'>justify</span> <span class='id identifier rubyid_group'>group</span><span class='lparen'>(</span><span class='id identifier rubyid_buttons'>buttons</span><span class='comma'>,</span> <span class='label'>padding:</span> <span class='id identifier rubyid_padding'>padding</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
1029
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
1030
|
+
<span class='id identifier rubyid_block_val'>block_val</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span>
|
1031
|
+
<span class='id identifier rubyid_block_val'>block_val</span> <span class='op'>=</span> <span class='id identifier rubyid_block_val'>block_val</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>, </span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_block_val'>block_val</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
|
1032
|
+
|
1033
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_function'>function</span>
|
1034
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_function'>function</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_block_val'>block_val</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
1035
|
+
<span class='kw'>else</span>
|
1036
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_block_val'>block_val</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1037
|
+
<span class='kw'>end</span>
|
1038
|
+
<span class='kw'>else</span>
|
1039
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_function'>function</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
1040
|
+
<span class='kw'>end</span>
|
1041
|
+
|
1042
|
+
<span class='id identifier rubyid_auto_comment'>auto_comment</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>case </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_str'>str</span><span class='embexpr_end'>}</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
1043
|
+
<span class='rbrace'>}</span>
|
1044
|
+
|
1045
|
+
<span class='id identifier rubyid_momentary_string'>momentary_string</span> <span class='op'>=</span> <span class='id identifier rubyid_momentary'>momentary</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n to[button.input];\n </span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1046
|
+
|
1047
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='heredoc_beg'><<EOS</span>
|
1048
|
+
<span class='embexpr_beg'>#{</span><span class='id identifier rubyid_button_event'>button_event</span> <span class='id identifier rubyid_buttons'>buttons</span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
1049
|
+
{
|
1050
|
+
push:
|
1051
|
+
{</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_momentary_string'>momentary_string</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
1052
|
+
switch (button.input.channel)
|
1053
|
+
{
|
1054
|
+
</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_case_string'>case_string</span> <span class='embexpr_end'>}</span><span class='tstring_content'>
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
|
1058
|
+
</span><span class='heredoc_end'>EOS
|
1059
|
+
</span>
|
1060
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_hold_block'>hold_block</span>
|
1061
|
+
<span class='id identifier rubyid_hold_string'>hold_string</span> <span class='op'>=</span> <span class='heredoc_beg'><<EOS</span>
|
1062
|
+
<span class='tstring_content'> hold[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_hold_time'>hold_time</span><span class='embexpr_end'>}</span><span class='tstring_content'>, repeat]:
|
1063
|
+
{
|
1064
|
+
switch (button.input.channel)
|
1065
|
+
{
|
1066
|
+
</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_case_string'>case_string</span> <span class='embexpr_end'>}</span><span class='tstring_content'>
|
1067
|
+
}
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
</span><span class='heredoc_end'>EOS
|
1071
|
+
</span> <span class='id identifier rubyid_output'>output</span> <span class='op'>+=</span> <span class='id identifier rubyid_hold_string'>hold_string</span>
|
1072
|
+
<span class='kw'>end</span>
|
1073
|
+
|
1074
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>+=</span>
|
1075
|
+
<span class='heredoc_beg'><<EOS</span>
|
1076
|
+
<span class='tstring_content'> release: {}
|
1077
|
+
}
|
1078
|
+
</span><span class='heredoc_end'>EOS
|
1079
|
+
</span> <span class='id identifier rubyid_output'>output</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span>
|
1080
|
+
<span class='kw'>end</span></pre>
|
1081
|
+
</td>
|
1082
|
+
</tr>
|
1083
|
+
</table>
|
1084
|
+
</div>
|
1085
|
+
|
1086
|
+
<div class="method_details ">
|
1087
|
+
<h3 class="signature " id="check_for_duplicate_values-instance_method">
|
1088
|
+
|
1089
|
+
- (<tt>Object</tt>) <strong>check_for_duplicate_values</strong>(*hashes)
|
1090
|
+
|
1091
|
+
|
1092
|
+
|
1093
|
+
|
1094
|
+
|
1095
|
+
</h3><div class="docstring">
|
1096
|
+
<div class="discussion">
|
1097
|
+
|
1098
|
+
<p>Ensures button number constants haven't been unintentionally
|
1099
|
+
duplicated.</p>
|
1100
|
+
|
1101
|
+
|
1102
|
+
</div>
|
1103
|
+
</div>
|
1104
|
+
<div class="tags">
|
1105
|
+
<p class="tag_title">Parameters:</p>
|
1106
|
+
<ul class="param">
|
1107
|
+
|
1108
|
+
<li>
|
1109
|
+
|
1110
|
+
<span class='name'>hashes</span>
|
1111
|
+
|
1112
|
+
|
1113
|
+
<span class='type'>(<tt>*<span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
1114
|
+
|
1115
|
+
|
1116
|
+
|
1117
|
+
</li>
|
1118
|
+
|
1119
|
+
</ul>
|
1120
|
+
|
1121
|
+
<p class="tag_title">Raises:</p>
|
1122
|
+
<ul class="raise">
|
1123
|
+
|
1124
|
+
<li>
|
1125
|
+
|
1126
|
+
|
1127
|
+
<span class='type'></span>
|
1128
|
+
|
1129
|
+
|
1130
|
+
|
1131
|
+
|
1132
|
+
<div class='inline'>
|
1133
|
+
<p>if two keys have the same value.</p>
|
1134
|
+
</div>
|
1135
|
+
|
1136
|
+
</li>
|
1137
|
+
|
1138
|
+
</ul>
|
1139
|
+
|
1140
|
+
</div><table class="source_code">
|
1141
|
+
<tr>
|
1142
|
+
<td>
|
1143
|
+
<pre class="lines">
|
1144
|
+
|
1145
|
+
|
1146
|
+
331
|
1147
|
+
332
|
1148
|
+
333</pre>
|
1149
|
+
</td>
|
1150
|
+
<td>
|
1151
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 331</span>
|
1152
|
+
|
1153
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_check_for_duplicate_values'>check_for_duplicate_values</span> <span class='op'>*</span><span class='id identifier rubyid_hashes'>hashes</span>
|
1154
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span>
|
1155
|
+
<span class='kw'>end</span></pre>
|
1156
|
+
</td>
|
1157
|
+
</tr>
|
1158
|
+
</table>
|
1159
|
+
</div>
|
1160
|
+
|
1161
|
+
<div class="method_details ">
|
1162
|
+
<h3 class="signature " id="execute_erb-instance_method">
|
1163
|
+
|
1164
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>execute_erb</strong>(template_file)
|
1165
|
+
|
1166
|
+
|
1167
|
+
|
1168
|
+
|
1169
|
+
|
1170
|
+
</h3><div class="docstring">
|
1171
|
+
<div class="discussion">
|
1172
|
+
|
1173
|
+
<p>Run ERB on the given template file.</p>
|
1174
|
+
|
1175
|
+
|
1176
|
+
</div>
|
1177
|
+
</div>
|
1178
|
+
<div class="tags">
|
1179
|
+
<p class="tag_title">Parameters:</p>
|
1180
|
+
<ul class="param">
|
1181
|
+
|
1182
|
+
<li>
|
1183
|
+
|
1184
|
+
<span class='name'>template_file</span>
|
1185
|
+
|
1186
|
+
|
1187
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1188
|
+
|
1189
|
+
|
1190
|
+
|
1191
|
+
—
|
1192
|
+
<div class='inline'>
|
1193
|
+
<p>file path</p>
|
1194
|
+
</div>
|
1195
|
+
|
1196
|
+
</li>
|
1197
|
+
|
1198
|
+
</ul>
|
1199
|
+
|
1200
|
+
<p class="tag_title">Returns:</p>
|
1201
|
+
<ul class="return">
|
1202
|
+
|
1203
|
+
<li>
|
1204
|
+
|
1205
|
+
|
1206
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1207
|
+
|
1208
|
+
|
1209
|
+
|
1210
|
+
—
|
1211
|
+
<div class='inline'>
|
1212
|
+
<p>ERB output.</p>
|
1213
|
+
</div>
|
1214
|
+
|
1215
|
+
</li>
|
1216
|
+
|
1217
|
+
</ul>
|
1218
|
+
<p class="tag_title">Raises:</p>
|
1219
|
+
<ul class="raise">
|
1220
|
+
|
1221
|
+
<li>
|
1222
|
+
|
1223
|
+
|
1224
|
+
<span class='type'>(<tt>LoadError</tt>)</span>
|
1225
|
+
|
1226
|
+
|
1227
|
+
|
1228
|
+
—
|
1229
|
+
<div class='inline'>
|
1230
|
+
<p>template not found</p>
|
1231
|
+
</div>
|
1232
|
+
|
1233
|
+
</li>
|
1234
|
+
|
1235
|
+
</ul>
|
1236
|
+
|
1237
|
+
</div><table class="source_code">
|
1238
|
+
<tr>
|
1239
|
+
<td>
|
1240
|
+
<pre class="lines">
|
1241
|
+
|
1242
|
+
|
1243
|
+
319
|
1244
|
+
320
|
1245
|
+
321
|
1246
|
+
322</pre>
|
1247
|
+
</td>
|
1248
|
+
<td>
|
1249
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 319</span>
|
1250
|
+
|
1251
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute_erb'>execute_erb</span> <span class='id identifier rubyid_template_file'>template_file</span>
|
1252
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>LoadError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Template not found: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_template_file'>template_file</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span> <span class='id identifier rubyid_template_file'>template_file</span>
|
1253
|
+
<span class='gvar'>$AUTOGEN_HEADER</span> <span class='op'>+</span> <span class='const'>ERB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='kw'>nil</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='period'>.</span><span class='id identifier rubyid_result'>result</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
1254
|
+
<span class='kw'>end</span></pre>
|
1255
|
+
</td>
|
1256
|
+
</tr>
|
1257
|
+
</table>
|
1258
|
+
</div>
|
1259
|
+
|
1260
|
+
<div class="method_details ">
|
1261
|
+
<h3 class="signature " id="generate_constant_ivars-instance_method">
|
1262
|
+
|
1263
|
+
- (<tt>Object</tt>) <strong>generate_constant_ivars</strong>(h, append_suffix: false)
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
|
1268
|
+
|
1269
|
+
</h3><div class="docstring">
|
1270
|
+
<div class="discussion">
|
1271
|
+
|
1272
|
+
<p>Generate instance variables for the DEFINE_CONSTANTS section from the given
|
1273
|
+
hash keys. Appends @tmpl_suffix if set.</p>
|
1274
|
+
|
1275
|
+
|
1276
|
+
</div>
|
1277
|
+
</div>
|
1278
|
+
<div class="tags">
|
1279
|
+
|
1280
|
+
|
1281
|
+
<p class="tag_title">See Also:</p>
|
1282
|
+
<ul class="see">
|
1283
|
+
|
1284
|
+
<li><span class='object_link'><a href="#print_variable_hash-instance_method" title="Helpers#print_variable_hash (method)">#print_variable_hash - for formatting</a></span></li>
|
1285
|
+
|
1286
|
+
</ul>
|
1287
|
+
|
1288
|
+
</div><table class="source_code">
|
1289
|
+
<tr>
|
1290
|
+
<td>
|
1291
|
+
<pre class="lines">
|
1292
|
+
|
1293
|
+
|
1294
|
+
130
|
1295
|
+
131
|
1296
|
+
132
|
1297
|
+
133
|
1298
|
+
134
|
1299
|
+
135
|
1300
|
+
136
|
1301
|
+
137
|
1302
|
+
138
|
1303
|
+
139</pre>
|
1304
|
+
</td>
|
1305
|
+
<td>
|
1306
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 130</span>
|
1307
|
+
|
1308
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_generate_constant_ivars'>generate_constant_ivars</span> <span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='label'>append_suffix:</span> <span class='kw'>false</span>
|
1309
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_each_key'>each_key</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
1310
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span>
|
1311
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='ivar'>@tmpl_suffix</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@tmpl_suffix</span> <span class='kw'>and</span> <span class='id identifier rubyid_append_suffix'>append_suffix</span>
|
1312
|
+
|
1313
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span> <span class='symbol'>:@</span><span class='embexpr_beg'>#{</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='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
1314
|
+
<span class='kw'>end</span>
|
1315
|
+
|
1316
|
+
<span class='id identifier rubyid_h'>h</span>
|
1317
|
+
<span class='kw'>end</span></pre>
|
1318
|
+
</td>
|
1319
|
+
</tr>
|
1320
|
+
</table>
|
1321
|
+
</div>
|
1322
|
+
|
1323
|
+
<div class="method_details ">
|
1324
|
+
<h3 class="signature " id="generate_variable_ivars-instance_method">
|
1325
|
+
|
1326
|
+
- (<tt>Object</tt>) <strong>generate_variable_ivars</strong>(h, append_suffix: true)
|
1327
|
+
|
1328
|
+
|
1329
|
+
|
1330
|
+
|
1331
|
+
|
1332
|
+
</h3><div class="docstring">
|
1333
|
+
<div class="discussion">
|
1334
|
+
|
1335
|
+
<p>Generate instance variables for the DEFINE_VARIABLES section from the given
|
1336
|
+
hash keys. Appends @tmpl_var_suffix if set.</p>
|
1337
|
+
|
1338
|
+
|
1339
|
+
</div>
|
1340
|
+
</div>
|
1341
|
+
<div class="tags">
|
1342
|
+
|
1343
|
+
|
1344
|
+
<p class="tag_title">See Also:</p>
|
1345
|
+
<ul class="see">
|
1346
|
+
|
1347
|
+
<li><span class='object_link'><a href="#print_variable_hash-instance_method" title="Helpers#print_variable_hash (method)">#print_variable_hash - for formatting</a></span></li>
|
1348
|
+
|
1349
|
+
</ul>
|
1350
|
+
|
1351
|
+
</div><table class="source_code">
|
1352
|
+
<tr>
|
1353
|
+
<td>
|
1354
|
+
<pre class="lines">
|
1355
|
+
|
1356
|
+
|
1357
|
+
145
|
1358
|
+
146
|
1359
|
+
147
|
1360
|
+
148
|
1361
|
+
149
|
1362
|
+
150
|
1363
|
+
151
|
1364
|
+
152
|
1365
|
+
153
|
1366
|
+
154</pre>
|
1367
|
+
</td>
|
1368
|
+
<td>
|
1369
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 145</span>
|
1370
|
+
|
1371
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_generate_variable_ivars'>generate_variable_ivars</span> <span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='label'>append_suffix:</span> <span class='kw'>true</span>
|
1372
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_each_key'>each_key</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
1373
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
|
1374
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='ivar'>@tmpl_suffix</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@tmpl_suffix</span> <span class='kw'>and</span> <span class='id identifier rubyid_append_suffix'>append_suffix</span>
|
1375
|
+
|
1376
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span> <span class='symbol'>:@</span><span class='embexpr_beg'>#{</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='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
1377
|
+
<span class='kw'>end</span>
|
1378
|
+
|
1379
|
+
<span class='id identifier rubyid_h'>h</span>
|
1380
|
+
<span class='kw'>end</span></pre>
|
1381
|
+
</td>
|
1382
|
+
</tr>
|
1383
|
+
</table>
|
1384
|
+
</div>
|
1385
|
+
|
1386
|
+
<div class="method_details ">
|
1387
|
+
<h3 class="signature " id="group-instance_method">
|
1388
|
+
|
1389
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>group</strong>(hash, padding: nil) {|key, value| ... }
|
1390
|
+
|
1391
|
+
|
1392
|
+
|
1393
|
+
|
1394
|
+
|
1395
|
+
</h3><div class="docstring">
|
1396
|
+
<div class="discussion">
|
1397
|
+
|
1398
|
+
<p>Generate a group of lines for a given hash.</p>
|
1399
|
+
|
1400
|
+
|
1401
|
+
</div>
|
1402
|
+
</div>
|
1403
|
+
<div class="tags">
|
1404
|
+
<p class="tag_title">Parameters:</p>
|
1405
|
+
<ul class="param">
|
1406
|
+
|
1407
|
+
<li>
|
1408
|
+
|
1409
|
+
<span class='name'>hash</span>
|
1410
|
+
|
1411
|
+
|
1412
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
1413
|
+
|
1414
|
+
|
1415
|
+
|
1416
|
+
</li>
|
1417
|
+
|
1418
|
+
<li>
|
1419
|
+
|
1420
|
+
<span class='name'>padding</span>
|
1421
|
+
|
1422
|
+
|
1423
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>, <tt>Numeric</tt>)</span>
|
1424
|
+
|
1425
|
+
|
1426
|
+
|
1427
|
+
—
|
1428
|
+
<div class='inline'>
|
1429
|
+
<p>whitespace placed in front of the string. Can be a string of spaces, or a
|
1430
|
+
number representing the indentation level.</p>
|
1431
|
+
</div>
|
1432
|
+
|
1433
|
+
</li>
|
1434
|
+
|
1435
|
+
</ul>
|
1436
|
+
|
1437
|
+
<p class="tag_title">Yields:</p>
|
1438
|
+
<ul class="yield">
|
1439
|
+
|
1440
|
+
<li>
|
1441
|
+
|
1442
|
+
|
1443
|
+
<span class='type'>(<tt>key</tt>, <tt>value</tt>)</span>
|
1444
|
+
|
1445
|
+
|
1446
|
+
|
1447
|
+
—
|
1448
|
+
<div class='inline'>
|
1449
|
+
<p>elements from hash</p>
|
1450
|
+
</div>
|
1451
|
+
|
1452
|
+
</li>
|
1453
|
+
|
1454
|
+
</ul>
|
1455
|
+
<p class="tag_title">Returns:</p>
|
1456
|
+
<ul class="return">
|
1457
|
+
|
1458
|
+
<li>
|
1459
|
+
|
1460
|
+
|
1461
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1462
|
+
|
1463
|
+
|
1464
|
+
|
1465
|
+
—
|
1466
|
+
<div class='inline'>
|
1467
|
+
<p>lines of source code</p>
|
1468
|
+
</div>
|
1469
|
+
|
1470
|
+
</li>
|
1471
|
+
|
1472
|
+
</ul>
|
1473
|
+
|
1474
|
+
</div><table class="source_code">
|
1475
|
+
<tr>
|
1476
|
+
<td>
|
1477
|
+
<pre class="lines">
|
1478
|
+
|
1479
|
+
|
1480
|
+
20
|
1481
|
+
21
|
1482
|
+
22
|
1483
|
+
23</pre>
|
1484
|
+
</td>
|
1485
|
+
<td>
|
1486
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 20</span>
|
1487
|
+
|
1488
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_group'>group</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>padding:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1489
|
+
<span class='id identifier rubyid_padding'>padding</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>*</span> <span class='lparen'>(</span><span class='int'>4</span> <span class='op'>*</span> <span class='id identifier rubyid_padding'>padding</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_padding'>padding</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span>
|
1490
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</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> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</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='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_str'>str</span><span class='op'>|</span> <span class='id identifier rubyid_padding'>padding</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='id identifier rubyid_str'>str</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1491
|
+
<span class='kw'>end</span></pre>
|
1492
|
+
</td>
|
1493
|
+
</tr>
|
1494
|
+
</table>
|
1495
|
+
</div>
|
1496
|
+
|
1497
|
+
<div class="method_details ">
|
1498
|
+
<h3 class="signature " id="hiqnet_empty-instance_method">
|
1499
|
+
|
1500
|
+
- (<tt>Object</tt>) <strong>hiqnet_empty</strong>
|
1501
|
+
|
1502
|
+
|
1503
|
+
|
1504
|
+
|
1505
|
+
|
1506
|
+
</h3><div class="docstring">
|
1507
|
+
<div class="discussion">
|
1508
|
+
|
1509
|
+
<p>Generate an empty HiQnet address string.</p>
|
1510
|
+
|
1511
|
+
|
1512
|
+
</div>
|
1513
|
+
</div>
|
1514
|
+
<div class="tags">
|
1515
|
+
|
1516
|
+
<div class="examples">
|
1517
|
+
<p class="tag_title">Examples:</p>
|
1518
|
+
|
1519
|
+
|
1520
|
+
<pre class="example code"><code><span class='comment'># Generates:
|
1521
|
+
</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0x000000000000</span><span class='tstring_end'>'</span></span></code></pre>
|
1522
|
+
|
1523
|
+
</div>
|
1524
|
+
|
1525
|
+
|
1526
|
+
</div><table class="source_code">
|
1527
|
+
<tr>
|
1528
|
+
<td>
|
1529
|
+
<pre class="lines">
|
1530
|
+
|
1531
|
+
|
1532
|
+
289
|
1533
|
+
290
|
1534
|
+
291</pre>
|
1535
|
+
</td>
|
1536
|
+
<td>
|
1537
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 289</span>
|
1538
|
+
|
1539
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hiqnet_empty'>hiqnet_empty</span>
|
1540
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0x</span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0</span><span class='tstring_end'>'</span></span> <span class='op'>*</span> <span class='int'>12</span><span class='rparen'>)</span>
|
1541
|
+
<span class='kw'>end</span></pre>
|
1542
|
+
</td>
|
1543
|
+
</tr>
|
1544
|
+
</table>
|
1545
|
+
</div>
|
1546
|
+
|
1547
|
+
<div class="method_details ">
|
1548
|
+
<h3 class="signature " id="justify-instance_method">
|
1549
|
+
|
1550
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>justify</strong>(str, amount: nil, type: nil)
|
1551
|
+
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1555
|
+
|
1556
|
+
</h3><div class="docstring">
|
1557
|
+
<div class="discussion">
|
1558
|
+
|
1559
|
+
<p>Left justify a block of code to line up on a type of character. Defaults to
|
1560
|
+
:equals (=).</p>
|
1561
|
+
|
1562
|
+
|
1563
|
+
</div>
|
1564
|
+
</div>
|
1565
|
+
<div class="tags">
|
1566
|
+
<p class="tag_title">Parameters:</p>
|
1567
|
+
<ul class="param">
|
1568
|
+
|
1569
|
+
<li>
|
1570
|
+
|
1571
|
+
<span class='name'>amount</span>
|
1572
|
+
|
1573
|
+
|
1574
|
+
<span class='type'>(<tt>Numeric</tt>)</span>
|
1575
|
+
|
1576
|
+
|
1577
|
+
|
1578
|
+
—
|
1579
|
+
<div class='inline'>
|
1580
|
+
<p>value of number of spaces, or the longest key in a hash.</p>
|
1581
|
+
</div>
|
1582
|
+
|
1583
|
+
</li>
|
1584
|
+
|
1585
|
+
<li>
|
1586
|
+
|
1587
|
+
<span class='name'>type</span>
|
1588
|
+
|
1589
|
+
|
1590
|
+
<span class='type'>(<tt>:equals</tt>, <tt>:colon</tt>, <tt>:comma</tt>, <tt>:comma_2</tt>, <tt>:semicolon</tt>)</span>
|
1591
|
+
|
1592
|
+
|
1593
|
+
|
1594
|
+
—
|
1595
|
+
<div class='inline'>
|
1596
|
+
<p>character to justify on.</p>
|
1597
|
+
</div>
|
1598
|
+
|
1599
|
+
</li>
|
1600
|
+
|
1601
|
+
</ul>
|
1602
|
+
|
1603
|
+
<p class="tag_title">Returns:</p>
|
1604
|
+
<ul class="return">
|
1605
|
+
|
1606
|
+
<li>
|
1607
|
+
|
1608
|
+
|
1609
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1610
|
+
|
1611
|
+
|
1612
|
+
|
1613
|
+
—
|
1614
|
+
<div class='inline'>
|
1615
|
+
<p>a group of justified lines of source code.</p>
|
1616
|
+
</div>
|
1617
|
+
|
1618
|
+
</li>
|
1619
|
+
|
1620
|
+
</ul>
|
1621
|
+
|
1622
|
+
</div><table class="source_code">
|
1623
|
+
<tr>
|
1624
|
+
<td>
|
1625
|
+
<pre class="lines">
|
1626
|
+
|
1627
|
+
|
1628
|
+
31
|
1629
|
+
32
|
1630
|
+
33
|
1631
|
+
34
|
1632
|
+
35
|
1633
|
+
36
|
1634
|
+
37
|
1635
|
+
38
|
1636
|
+
39
|
1637
|
+
40
|
1638
|
+
41
|
1639
|
+
42
|
1640
|
+
43
|
1641
|
+
44
|
1642
|
+
45
|
1643
|
+
46
|
1644
|
+
47
|
1645
|
+
48
|
1646
|
+
49
|
1647
|
+
50
|
1648
|
+
51
|
1649
|
+
52
|
1650
|
+
53
|
1651
|
+
54
|
1652
|
+
55
|
1653
|
+
56
|
1654
|
+
57
|
1655
|
+
58
|
1656
|
+
59
|
1657
|
+
60
|
1658
|
+
61
|
1659
|
+
62
|
1660
|
+
63
|
1661
|
+
64
|
1662
|
+
65
|
1663
|
+
66
|
1664
|
+
67
|
1665
|
+
68
|
1666
|
+
69
|
1667
|
+
70
|
1668
|
+
71
|
1669
|
+
72
|
1670
|
+
73
|
1671
|
+
74
|
1672
|
+
75
|
1673
|
+
76
|
1674
|
+
77
|
1675
|
+
78
|
1676
|
+
79</pre>
|
1677
|
+
</td>
|
1678
|
+
<td>
|
1679
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 31</span>
|
1680
|
+
|
1681
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_justify'>justify</span> <span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='label'>amount:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='kw'>nil</span>
|
1682
|
+
<span class='comment'># justification_amount = amount.is_a?(Numeric) ? amount : amount.map { |key, _| key.to_s.size }.max
|
1683
|
+
</span>
|
1684
|
+
<span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
1685
|
+
|
1686
|
+
<span class='id identifier rubyid_justify_types'>justify_types</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
1687
|
+
<span class='label'>equals:</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span>
|
1688
|
+
<span class='label'>colon:</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span>
|
1689
|
+
<span class='label'>comma:</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span>
|
1690
|
+
<span class='label'>comma_2:</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span>
|
1691
|
+
<span class='label'>semicolon:</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span>
|
1692
|
+
<span class='rbrace'>}</span>
|
1693
|
+
|
1694
|
+
<span class='comment'># Types that will be chosen from automatically if no type is specified
|
1695
|
+
</span> <span class='id identifier rubyid_auto_justify_types'>auto_justify_types</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:equals</span><span class='comma'>,</span> <span class='symbol'>:colon</span><span class='rbracket'>]</span>
|
1696
|
+
|
1697
|
+
<span class='id identifier rubyid_justify_by'>justify_by</span> <span class='op'>=</span> <span class='id identifier rubyid_justify_types'>justify_types</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
1698
|
+
<span class='id identifier rubyid_auto_justify_types'>auto_justify_types</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1699
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
1700
|
+
<span class='id identifier rubyid_justify_by'>justify_by</span> <span class='op'>=</span> <span class='id identifier rubyid_justify_by'>justify_by</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_justify_by'>justify_by</span>
|
1701
|
+
<span class='id identifier rubyid_justify_by'>justify_by</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span> <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span>
|
1702
|
+
|
1703
|
+
<span class='id identifier rubyid_justify_amount'>justify_amount</span> <span class='op'>=</span> <span class='id identifier rubyid_amount'>amount</span> <span class='op'>||</span> <span class='id identifier rubyid_justify_types'>justify_types</span><span class='lbracket'>[</span><span class='id identifier rubyid_justify_by'>justify_by</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
|
1704
|
+
|
1705
|
+
<span class='comment'># Rebuild each line with the appropriate justification.
|
1706
|
+
</span> <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
|
1707
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1708
|
+
|
1709
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_justify_by'>justify_by</span>
|
1710
|
+
<span class='kw'>when</span> <span class='symbol'>:equals</span>
|
1711
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?)(=.*)</span><span class='regexp_end'>/</span></span>
|
1712
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>:</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='id identifier rubyid_justify_amount'>justify_amount</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='backref'>$2</span>
|
1713
|
+
<span class='kw'>when</span> <span class='symbol'>:colon</span>
|
1714
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?\:)\s*(.*)</span><span class='regexp_end'>/</span></span>
|
1715
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>:</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='id identifier rubyid_justify_amount'>justify_amount</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='backref'>$2</span>
|
1716
|
+
<span class='kw'>when</span> <span class='symbol'>:comma</span>
|
1717
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?\,)\s*(.*)</span><span class='regexp_end'>/</span></span>
|
1718
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>:</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='id identifier rubyid_justify_amount'>justify_amount</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='backref'>$2</span>
|
1719
|
+
<span class='kw'>when</span> <span class='symbol'>:comma_2</span>
|
1720
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?\,.*?\,)\s*(.*)</span><span class='regexp_end'>/</span></span>
|
1721
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>:</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='id identifier rubyid_justify_amount'>justify_amount</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='backref'>$2</span>
|
1722
|
+
<span class='kw'>when</span> <span class='symbol'>:semicolon</span>
|
1723
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?\;)\s*(.*)</span><span class='regexp_end'>/</span></span>
|
1724
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>:</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='id identifier rubyid_justify_amount'>justify_amount</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='backref'>$2</span>
|
1725
|
+
<span class='kw'>else</span>
|
1726
|
+
<span class='id identifier rubyid_line'>line</span>
|
1727
|
+
<span class='kw'>end</span>
|
1728
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
1729
|
+
<span class='kw'>end</span></pre>
|
1730
|
+
</td>
|
1731
|
+
</tr>
|
1732
|
+
</table>
|
1733
|
+
</div>
|
1734
|
+
|
1735
|
+
<div class="method_details ">
|
1736
|
+
<h3 class="signature " id="print_constant_hash-instance_method">
|
1737
|
+
|
1738
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>print_constant_hash</strong>(h, justify: nil)
|
1739
|
+
|
1740
|
+
|
1741
|
+
|
1742
|
+
|
1743
|
+
|
1744
|
+
</h3><div class="docstring">
|
1745
|
+
<div class="discussion">
|
1746
|
+
|
1747
|
+
<p>Print the list of constants.</p>
|
1748
|
+
|
1749
|
+
|
1750
|
+
</div>
|
1751
|
+
</div>
|
1752
|
+
<div class="tags">
|
1753
|
+
<p class="tag_title">Parameters:</p>
|
1754
|
+
<ul class="param">
|
1755
|
+
|
1756
|
+
<li>
|
1757
|
+
|
1758
|
+
<span class='name'>h</span>
|
1759
|
+
|
1760
|
+
|
1761
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
1762
|
+
|
1763
|
+
|
1764
|
+
|
1765
|
+
—
|
1766
|
+
<div class='inline'>
|
1767
|
+
<p>constant names as keys.</p>
|
1768
|
+
</div>
|
1769
|
+
|
1770
|
+
</li>
|
1771
|
+
|
1772
|
+
<li>
|
1773
|
+
|
1774
|
+
<span class='name'>justify</span>
|
1775
|
+
|
1776
|
+
|
1777
|
+
<span class='type'>(<tt>Numeric</tt>)</span>
|
1778
|
+
|
1779
|
+
|
1780
|
+
|
1781
|
+
—
|
1782
|
+
<div class='inline'>
|
1783
|
+
<p>column number to justify equals symbol (=) on.</p>
|
1784
|
+
</div>
|
1785
|
+
|
1786
|
+
</li>
|
1787
|
+
|
1788
|
+
</ul>
|
1789
|
+
|
1790
|
+
<p class="tag_title">Returns:</p>
|
1791
|
+
<ul class="return">
|
1792
|
+
|
1793
|
+
<li>
|
1794
|
+
|
1795
|
+
|
1796
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1797
|
+
|
1798
|
+
|
1799
|
+
|
1800
|
+
—
|
1801
|
+
<div class='inline'>
|
1802
|
+
<p>a group of justified lines of source code.</p>
|
1803
|
+
</div>
|
1804
|
+
|
1805
|
+
</li>
|
1806
|
+
|
1807
|
+
</ul>
|
1808
|
+
|
1809
|
+
</div><table class="source_code">
|
1810
|
+
<tr>
|
1811
|
+
<td>
|
1812
|
+
<pre class="lines">
|
1813
|
+
|
1814
|
+
|
1815
|
+
99
|
1816
|
+
100
|
1817
|
+
101
|
1818
|
+
102
|
1819
|
+
103</pre>
|
1820
|
+
</td>
|
1821
|
+
<td>
|
1822
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 99</span>
|
1823
|
+
|
1824
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_print_constant_hash'>print_constant_hash</span> <span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='label'>justify:</span> <span class='kw'>nil</span>
|
1825
|
+
<span class='comment'># TODO: Refactor to use #justify.
|
1826
|
+
</span> <span class='id identifier rubyid_max_len'>max_len</span> <span class='op'>=</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
|
1827
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span> <span class='id identifier rubyid_justify'>justify</span> <span class='op'>||</span> <span class='id identifier rubyid_max_len'>max_len</span><span class='embexpr_end'>}</span><span class='tstring_content'> = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1828
|
+
<span class='kw'>end</span></pre>
|
1829
|
+
</td>
|
1830
|
+
</tr>
|
1831
|
+
</table>
|
1832
|
+
</div>
|
1833
|
+
|
1834
|
+
<div class="method_details ">
|
1835
|
+
<h3 class="signature " id="print_device_hash-instance_method">
|
1836
|
+
|
1837
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>print_device_hash</strong>(h, justify: nil)
|
1838
|
+
|
1839
|
+
|
1840
|
+
|
1841
|
+
|
1842
|
+
|
1843
|
+
</h3><div class="docstring">
|
1844
|
+
<div class="discussion">
|
1845
|
+
|
1846
|
+
<p>Print the list of devices.</p>
|
1847
|
+
|
1848
|
+
|
1849
|
+
</div>
|
1850
|
+
</div>
|
1851
|
+
<div class="tags">
|
1852
|
+
<p class="tag_title">Parameters:</p>
|
1853
|
+
<ul class="param">
|
1854
|
+
|
1855
|
+
<li>
|
1856
|
+
|
1857
|
+
<span class='name'>h</span>
|
1858
|
+
|
1859
|
+
|
1860
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
1861
|
+
|
1862
|
+
|
1863
|
+
|
1864
|
+
—
|
1865
|
+
<div class='inline'>
|
1866
|
+
<p>device names as keys.</p>
|
1867
|
+
</div>
|
1868
|
+
|
1869
|
+
</li>
|
1870
|
+
|
1871
|
+
<li>
|
1872
|
+
|
1873
|
+
<span class='name'>justify</span>
|
1874
|
+
|
1875
|
+
|
1876
|
+
<span class='type'>(<tt>Numeric</tt>)</span>
|
1877
|
+
|
1878
|
+
|
1879
|
+
|
1880
|
+
—
|
1881
|
+
<div class='inline'>
|
1882
|
+
<p>column number to justify equals symbol (=) on.</p>
|
1883
|
+
</div>
|
1884
|
+
|
1885
|
+
</li>
|
1886
|
+
|
1887
|
+
</ul>
|
1888
|
+
|
1889
|
+
<p class="tag_title">Returns:</p>
|
1890
|
+
<ul class="return">
|
1891
|
+
|
1892
|
+
<li>
|
1893
|
+
|
1894
|
+
|
1895
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1896
|
+
|
1897
|
+
|
1898
|
+
|
1899
|
+
—
|
1900
|
+
<div class='inline'>
|
1901
|
+
<p>a group of justified lines of source code.</p>
|
1902
|
+
</div>
|
1903
|
+
|
1904
|
+
</li>
|
1905
|
+
|
1906
|
+
</ul>
|
1907
|
+
|
1908
|
+
</div><table class="source_code">
|
1909
|
+
<tr>
|
1910
|
+
<td>
|
1911
|
+
<pre class="lines">
|
1912
|
+
|
1913
|
+
|
1914
|
+
89
|
1915
|
+
90
|
1916
|
+
91
|
1917
|
+
92
|
1918
|
+
93</pre>
|
1919
|
+
</td>
|
1920
|
+
<td>
|
1921
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 89</span>
|
1922
|
+
|
1923
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_print_device_hash'>print_device_hash</span> <span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='label'>justify:</span> <span class='kw'>nil</span>
|
1924
|
+
<span class='comment'># TODO: Refactor to use #justify.
|
1925
|
+
</span> <span class='id identifier rubyid_max_len'>max_len</span> <span class='op'>=</span> <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
|
1926
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dv</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span> <span class='id identifier rubyid_justify'>justify</span> <span class='op'>||</span> <span class='id identifier rubyid_max_len'>max_len</span><span class='embexpr_end'>}</span><span class='tstring_content'> = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1927
|
+
<span class='kw'>end</span></pre>
|
1928
|
+
</td>
|
1929
|
+
</tr>
|
1930
|
+
</table>
|
1931
|
+
</div>
|
1932
|
+
|
1933
|
+
<div class="method_details ">
|
1934
|
+
<h3 class="signature " id="print_variable_hash-instance_method">
|
1935
|
+
|
1936
|
+
- (<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>) <strong>print_variable_hash</strong>(h)
|
1937
|
+
|
1938
|
+
|
1939
|
+
|
1940
|
+
|
1941
|
+
|
1942
|
+
</h3><div class="docstring">
|
1943
|
+
<div class="discussion">
|
1944
|
+
|
1945
|
+
<p>Print the list of variables. Format:</p>
|
1946
|
+
|
1947
|
+
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
1948
|
+
<span class='label'>var_name:</span> <span class='lbrace'>{</span> <span class='label'>type:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>comment:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my var</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
1949
|
+
<span class='rbrace'>}</span>
|
1950
|
+
</code></pre>
|
1951
|
+
|
1952
|
+
|
1953
|
+
</div>
|
1954
|
+
</div>
|
1955
|
+
<div class="tags">
|
1956
|
+
<p class="tag_title">Parameters:</p>
|
1957
|
+
<ul class="param">
|
1958
|
+
|
1959
|
+
<li>
|
1960
|
+
|
1961
|
+
<span class='name'>h</span>
|
1962
|
+
|
1963
|
+
|
1964
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
|
1965
|
+
|
1966
|
+
|
1967
|
+
|
1968
|
+
—
|
1969
|
+
<div class='inline'>
|
1970
|
+
<p>variable names as keys.</p>
|
1971
|
+
</div>
|
1972
|
+
|
1973
|
+
</li>
|
1974
|
+
|
1975
|
+
</ul>
|
1976
|
+
|
1977
|
+
<p class="tag_title">Returns:</p>
|
1978
|
+
<ul class="return">
|
1979
|
+
|
1980
|
+
<li>
|
1981
|
+
|
1982
|
+
|
1983
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
1984
|
+
|
1985
|
+
|
1986
|
+
|
1987
|
+
—
|
1988
|
+
<div class='inline'>
|
1989
|
+
<p>a group of justified lines of source code.</p>
|
1990
|
+
</div>
|
1991
|
+
|
1992
|
+
</li>
|
1993
|
+
|
1994
|
+
</ul>
|
1995
|
+
|
1996
|
+
</div><table class="source_code">
|
1997
|
+
<tr>
|
1998
|
+
<td>
|
1999
|
+
<pre class="lines">
|
2000
|
+
|
2001
|
+
|
2002
|
+
112
|
2003
|
+
113
|
2004
|
+
114
|
2005
|
+
115
|
2006
|
+
116
|
2007
|
+
117
|
2008
|
+
118
|
2009
|
+
119
|
2010
|
+
120
|
2011
|
+
121
|
2012
|
+
122
|
2013
|
+
123
|
2014
|
+
124</pre>
|
2015
|
+
</td>
|
2016
|
+
<td>
|
2017
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 112</span>
|
2018
|
+
|
2019
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_print_variable_hash'>print_variable_hash</span> <span class='id identifier rubyid_h'>h</span>
|
2020
|
+
<span class='id identifier rubyid_justify'>justify</span> <span class='id identifier rubyid_group'>group</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='op'>|</span>
|
2021
|
+
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:type</span><span class='comma'>,</span> <span class='symbol'>:integer</span>
|
2022
|
+
<span class='id identifier rubyid_default'>default</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:default</span><span class='comma'>,</span> <span class='kw'>nil</span>
|
2023
|
+
<span class='id identifier rubyid_comment'>comment</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:comment</span><span class='comma'>,</span> <span class='kw'>nil</span>
|
2024
|
+
|
2025
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
2026
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_default'>default</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_default'>default</span>
|
2027
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span>
|
2028
|
+
<span class='id identifier rubyid_output'>output</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> // </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_comment'>comment</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_comment'>comment</span>
|
2029
|
+
<span class='id identifier rubyid_output'>output</span>
|
2030
|
+
<span class='rbrace'>}</span>
|
2031
|
+
<span class='kw'>end</span></pre>
|
2032
|
+
</td>
|
2033
|
+
</tr>
|
2034
|
+
</table>
|
2035
|
+
</div>
|
2036
|
+
|
2037
|
+
<div class="method_details ">
|
2038
|
+
<h3 class="signature " id="show_control-instance_method">
|
2039
|
+
|
2040
|
+
- (<tt>Object</tt>) <strong>show_control</strong>(control, show, device: @dvTP)
|
2041
|
+
|
2042
|
+
|
2043
|
+
|
2044
|
+
|
2045
|
+
|
2046
|
+
</h3><div class="docstring">
|
2047
|
+
<div class="discussion">
|
2048
|
+
|
2049
|
+
<p>Send a touch panel command to show or hide a control.</p>
|
2050
|
+
|
2051
|
+
|
2052
|
+
</div>
|
2053
|
+
</div>
|
2054
|
+
<div class="tags">
|
2055
|
+
|
2056
|
+
<div class="examples">
|
2057
|
+
<p class="tag_title">Examples:</p>
|
2058
|
+
|
2059
|
+
|
2060
|
+
<pre class="example code"><code>^SHO-<control>,<0|1></code></pre>
|
2061
|
+
|
2062
|
+
</div>
|
2063
|
+
<p class="tag_title">Parameters:</p>
|
2064
|
+
<ul class="param">
|
2065
|
+
|
2066
|
+
<li>
|
2067
|
+
|
2068
|
+
<span class='name'>control</span>
|
2069
|
+
|
2070
|
+
|
2071
|
+
<span class='type'>(<tt>Symbol</tt>, <tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
2072
|
+
|
2073
|
+
|
2074
|
+
|
2075
|
+
—
|
2076
|
+
<div class='inline'>
|
2077
|
+
<p>address or constant of a control</p>
|
2078
|
+
</div>
|
2079
|
+
|
2080
|
+
</li>
|
2081
|
+
|
2082
|
+
<li>
|
2083
|
+
|
2084
|
+
<span class='name'>show</span>
|
2085
|
+
|
2086
|
+
|
2087
|
+
<span class='type'>(<tt>Boolean</tt>, <tt>Numeric</tt>, <tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
2088
|
+
|
2089
|
+
|
2090
|
+
|
2091
|
+
—
|
2092
|
+
<div class='inline'>
|
2093
|
+
<p>0/1 print verbatim. true/fase convert to 0/1. string expression is wrapped
|
2094
|
+
in itoa().</p>
|
2095
|
+
</div>
|
2096
|
+
|
2097
|
+
</li>
|
2098
|
+
|
2099
|
+
</ul>
|
2100
|
+
|
2101
|
+
|
2102
|
+
</div><table class="source_code">
|
2103
|
+
<tr>
|
2104
|
+
<td>
|
2105
|
+
<pre class="lines">
|
2106
|
+
|
2107
|
+
|
2108
|
+
301
|
2109
|
+
302
|
2110
|
+
303
|
2111
|
+
304
|
2112
|
+
305
|
2113
|
+
306
|
2114
|
+
307
|
2115
|
+
308
|
2116
|
+
309
|
2117
|
+
310
|
2118
|
+
311
|
2119
|
+
312
|
2120
|
+
313</pre>
|
2121
|
+
</td>
|
2122
|
+
<td>
|
2123
|
+
<pre class="code"><span class="info file"># File 'lib/netlinx/erb/helpers.rb', line 301</span>
|
2124
|
+
|
2125
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_show_control'>show_control</span> <span class='id identifier rubyid_control'>control</span><span class='comma'>,</span> <span class='id identifier rubyid_show'>show</span><span class='comma'>,</span> <span class='label'>device:</span> <span class='ivar'>@dvTP</span>
|
2126
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>send_command </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_device'>device</span><span class='embexpr_end'>}</span><span class='tstring_content'>, \"'^SHO-', itoa(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_control'>control</span><span class='embexpr_end'>}</span><span class='tstring_content'>), ',</span><span class='tstring_end'>"</span></span>
|
2127
|
+
|
2128
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_show'>show</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Fixnum</span>
|
2129
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_show'>show</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
2130
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_show'>show</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='kw'>or</span> <span class='id identifier rubyid_show'>show</span> <span class='op'>==</span> <span class='kw'>false</span> <span class='kw'>or</span> <span class='id identifier rubyid_show'>show</span> <span class='op'>==</span> <span class='kw'>nil</span>
|
2131
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_show'>show</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
2132
|
+
<span class='kw'>else</span>
|
2133
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>', itoa(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_show'>show</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
2134
|
+
<span class='kw'>end</span>
|
2135
|
+
|
2136
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\";</span><span class='tstring_end'>"</span></span>
|
2137
|
+
<span class='kw'>end</span></pre>
|
2138
|
+
</td>
|
2139
|
+
</tr>
|
2140
|
+
</table>
|
2141
|
+
</div>
|
2142
|
+
|
2143
|
+
</div>
|
2144
|
+
|
2145
|
+
</div>
|
2146
|
+
|
2147
|
+
<div id="footer">
|
2148
|
+
Generated on Fri Jan 30 11:09:15 2015 by
|
2149
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2150
|
+
0.8.7.6 (ruby-2.1.3).
|
2151
|
+
</div>
|
2152
|
+
|
2153
|
+
</body>
|
2154
|
+
</html>
|