iqeo-conf 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -2
- data/.yardoc/checksums +2 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +2 -0
- data/Gemfile.lock +8 -2
- data/README.md +88 -60
- data/Rakefile +15 -7
- data/doc/Iqeo/Configuration.html +974 -0
- data/doc/Iqeo.html +128 -0
- data/doc/_index.html +125 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +206 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +206 -0
- data/doc/js/app.js +208 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +140 -0
- data/doc/top-level-namespace.html +112 -0
- data/iqeo-conf.gemspec +6 -3
- data/lib/iqeo/configuration/version.rb +2 -1
- data/lib/iqeo/configuration.rb +28 -8
- data/spec/configuration_spec.rb +9 -9
- metadata +62 -20
- data/.rspec +0 -2
- data/.rvmrc +0 -1
- data/pkg/iqeo-conf-0.0.1.gem +0 -0
- data/pkg/iqeo-conf-0.0.2.gem +0 -0
- data/pkg/iqeo-conf-0.0.3.gem +0 -0
- data/pkg/iqeo-conf-0.0.4.gem +0 -0
- data/pkg/iqeo-conf-0.0.5.gem +0 -0
- data/pkg/iqeo-conf-0.0.6.gem +0 -0
- data/pkg/iqeo-conf-0.0.7.gem +0 -0
- data/pkg/iqeo-conf-0.0.8.gem +0 -0
- data/pkg/iqeo-conf-0.0.9.gem +0 -0
@@ -0,0 +1,974 @@
|
|
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
|
+
Class: Iqeo::Configuration
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Iqeo.html" title="Iqeo (module)">Iqeo</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Configuration</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>Class: Iqeo::Configuration
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Iqeo::Configuration</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/iqeo/configuration.rb<span class="defines">,<br />
|
98
|
+
lib/iqeo/configuration/version.rb</span>
|
99
|
+
</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Configuration class.</p>
|
108
|
+
|
109
|
+
<p>A DSL representing configuration files.</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
<h2>Constant Summary</h2>
|
119
|
+
|
120
|
+
<dl class="constants">
|
121
|
+
|
122
|
+
<dt id="VERSION-constant" class="">VERSION =
|
123
|
+
<div class="docstring">
|
124
|
+
<div class="discussion">
|
125
|
+
|
126
|
+
<p>Current semantic version number</p>
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
<div class="tags">
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
</dt>
|
136
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.11</span><span class='tstring_end'>"</span></span></pre></dd>
|
137
|
+
|
138
|
+
</dl>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
145
|
+
<ul class="summary">
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#_parent-instance_method" title="#_parent (instance method)">- (Object) <strong>_parent</strong> </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<span class="summary_desc"><div class='inline'>
|
168
|
+
<p>Returns the value of attribute _parent.</p>
|
169
|
+
</div></span>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
|
173
|
+
|
174
|
+
</ul>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<h2>
|
181
|
+
Class Method Summary
|
182
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
183
|
+
</h2>
|
184
|
+
|
185
|
+
<ul class="summary">
|
186
|
+
|
187
|
+
<li class="public ">
|
188
|
+
<span class="summary_signature">
|
189
|
+
|
190
|
+
<a href="#load-class_method" title="load (class method)">+ (Object) <strong>load</strong>(file) </a>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</span>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<span class="summary_desc"><div class='inline'>
|
205
|
+
<p>Creates a new Configuration instance from filename or File/IO object.</p>
|
206
|
+
</div></span>
|
207
|
+
|
208
|
+
</li>
|
209
|
+
|
210
|
+
|
211
|
+
<li class="public ">
|
212
|
+
<span class="summary_signature">
|
213
|
+
|
214
|
+
<a href="#new_defer_block_for_parent-class_method" title="new_defer_block_for_parent (class method)">+ (Object) <strong>new_defer_block_for_parent</strong>(parent, &block) </a>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</span>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
229
|
+
|
230
|
+
</li>
|
231
|
+
|
232
|
+
|
233
|
+
<li class="public ">
|
234
|
+
<span class="summary_signature">
|
235
|
+
|
236
|
+
<a href="#read-class_method" title="read (class method)">+ (Object) <strong>read</strong>(string) </a>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="summary_desc"><div class='inline'>
|
251
|
+
<p>Creates a new Configuration instance from string.</p>
|
252
|
+
</div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
<li class="public ">
|
258
|
+
<span class="summary_signature">
|
259
|
+
|
260
|
+
<a href="#version-class_method" title="version (class method)">+ (Object) <strong>version</strong> </a>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</span>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<span class="summary_desc"><div class='inline'>
|
275
|
+
<p>Returns Configuration version number.</p>
|
276
|
+
</div></span>
|
277
|
+
|
278
|
+
</li>
|
279
|
+
|
280
|
+
|
281
|
+
</ul>
|
282
|
+
|
283
|
+
<h2>
|
284
|
+
Instance Method Summary
|
285
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
286
|
+
</h2>
|
287
|
+
|
288
|
+
<ul class="summary">
|
289
|
+
|
290
|
+
<li class="public ">
|
291
|
+
<span class="summary_signature">
|
292
|
+
|
293
|
+
<a href="#_get-instance_method" title="#_get (instance method)">- (Object) <strong>_get</strong>(key) </a>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
(also: #[])
|
298
|
+
|
299
|
+
</span>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<span class="summary_desc"><div class='inline'>
|
310
|
+
<p>Retrieves value for key, indifferent storage permits key to be a string or
|
311
|
+
symbol.</p>
|
312
|
+
</div></span>
|
313
|
+
|
314
|
+
</li>
|
315
|
+
|
316
|
+
|
317
|
+
<li class="public ">
|
318
|
+
<span class="summary_signature">
|
319
|
+
|
320
|
+
<a href="#_load-instance_method" title="#_load (instance method)">- (Object) <strong>_load</strong>(file) </a>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</span>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
335
|
+
|
336
|
+
</li>
|
337
|
+
|
338
|
+
|
339
|
+
<li class="public ">
|
340
|
+
<span class="summary_signature">
|
341
|
+
|
342
|
+
<a href="#_read-instance_method" title="#_read (instance method)">- (Object) <strong>_read</strong>(string) </a>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</span>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
357
|
+
|
358
|
+
</li>
|
359
|
+
|
360
|
+
|
361
|
+
<li class="public ">
|
362
|
+
<span class="summary_signature">
|
363
|
+
|
364
|
+
<a href="#_set-instance_method" title="#_set (instance method)">- (Object) <strong>_set</strong>(key, value) </a>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
(also: #[]=)
|
369
|
+
|
370
|
+
</span>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
381
|
+
|
382
|
+
</li>
|
383
|
+
|
384
|
+
|
385
|
+
<li class="public ">
|
386
|
+
<span class="summary_signature">
|
387
|
+
|
388
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Configuration) <strong>initialize</strong>(&block) </a>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
</span>
|
393
|
+
|
394
|
+
|
395
|
+
<span class="note title constructor">constructor</span>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
<span class="summary_desc"><div class='inline'>
|
405
|
+
<p>A new instance of Configuration.</p>
|
406
|
+
</div></span>
|
407
|
+
|
408
|
+
</li>
|
409
|
+
|
410
|
+
|
411
|
+
<li class="public ">
|
412
|
+
<span class="summary_signature">
|
413
|
+
|
414
|
+
<a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(name, *values, &block) </a>
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</span>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
429
|
+
|
430
|
+
</li>
|
431
|
+
|
432
|
+
|
433
|
+
</ul>
|
434
|
+
|
435
|
+
|
436
|
+
<div id="constructor_details" class="method_details_list">
|
437
|
+
<h2>Constructor Details</h2>
|
438
|
+
|
439
|
+
<div class="method_details first">
|
440
|
+
<h3 class="signature first" id="initialize-instance_method">
|
441
|
+
|
442
|
+
- (<tt><span class='object_link'><a href="" title="Iqeo::Configuration (class)">Configuration</a></span></tt>) <strong>initialize</strong>(&block)
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
</h3><div class="docstring">
|
449
|
+
<div class="discussion">
|
450
|
+
|
451
|
+
<p>A new instance of Configuration</p>
|
452
|
+
|
453
|
+
|
454
|
+
</div>
|
455
|
+
</div>
|
456
|
+
<div class="tags">
|
457
|
+
|
458
|
+
|
459
|
+
</div><table class="source_code">
|
460
|
+
<tr>
|
461
|
+
<td>
|
462
|
+
<pre class="lines">
|
463
|
+
|
464
|
+
|
465
|
+
55
|
466
|
+
56
|
467
|
+
57
|
468
|
+
58
|
469
|
+
59
|
470
|
+
60
|
471
|
+
61
|
472
|
+
62
|
473
|
+
63
|
474
|
+
64
|
475
|
+
65
|
476
|
+
66
|
477
|
+
67
|
478
|
+
68</pre>
|
479
|
+
</td>
|
480
|
+
<td>
|
481
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 55</span>
|
482
|
+
|
483
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
484
|
+
<span class='ivar'>@items</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
485
|
+
<span class='ivar'>@_parent</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
486
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
487
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># cannot set parent for yield blocks here as self is wrong !?
|
488
|
+
</span> <span class='kw'>yield</span> <span class='kw'>self</span>
|
489
|
+
<span class='kw'>else</span>
|
490
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>self</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span> <span class='const'>Configuration</span> <span class='rparen'>)</span> <span class='comment'># for eval block if nested configuration
|
491
|
+
</span> <span class='ivar'>@_parent</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>self</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'># set parent to make inherited values available
|
492
|
+
</span> <span class='kw'>end</span> <span class='comment'># during block execution
|
493
|
+
</span> <span class='id identifier rubyid_instance_eval'>instance_eval</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
494
|
+
<span class='kw'>end</span>
|
495
|
+
<span class='kw'>end</span>
|
496
|
+
<span class='kw'>end</span></pre>
|
497
|
+
</td>
|
498
|
+
</tr>
|
499
|
+
</table>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
</div>
|
503
|
+
<div id="method_missing_details" class="method_details_list">
|
504
|
+
<h2>Dynamic Method Handling</h2>
|
505
|
+
<p class="notice this">
|
506
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
507
|
+
|
508
|
+
</p>
|
509
|
+
|
510
|
+
<div class="method_details first">
|
511
|
+
<h3 class="signature first" id="method_missing-instance_method">
|
512
|
+
|
513
|
+
- (<tt>Object</tt>) <strong>method_missing</strong>(name, *values, &block)
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
</h3><table class="source_code">
|
520
|
+
<tr>
|
521
|
+
<td>
|
522
|
+
<pre class="lines">
|
523
|
+
|
524
|
+
|
525
|
+
70
|
526
|
+
71
|
527
|
+
72
|
528
|
+
73
|
529
|
+
74
|
530
|
+
75
|
531
|
+
76
|
532
|
+
77
|
533
|
+
78
|
534
|
+
79
|
535
|
+
80
|
536
|
+
81
|
537
|
+
82
|
538
|
+
83
|
539
|
+
84
|
540
|
+
85
|
541
|
+
86</pre>
|
542
|
+
</td>
|
543
|
+
<td>
|
544
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 70</span>
|
545
|
+
|
546
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_values'>values</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
547
|
+
<span class='kw'>return</span> <span class='ivar'>@items</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_values'>values</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@items</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='id identifier rubyid_name'>name</span> <span class='comment'># @items methods are highest priority
|
548
|
+
</span>
|
549
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</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_chomp'>chomp</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>=</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
550
|
+
|
551
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='comment'># block is a nested configuration
|
552
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># yield DSL needs deferred block to set parent without binding
|
553
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid__set'>_set</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_new_defer_block_for_parent'>new_defer_block_for_parent</span><span class='lparen'>(</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='rparen'>)</span>
|
554
|
+
<span class='kw'>else</span>
|
555
|
+
<span class='kw'>return</span> <span class='id identifier rubyid__set'>_set</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='rparen'>)</span> <span class='comment'># eval DSL can set parent from block binding in initialize
|
556
|
+
</span> <span class='kw'>end</span>
|
557
|
+
<span class='kw'>end</span>
|
558
|
+
|
559
|
+
<span class='kw'>return</span> <span class='id identifier rubyid__get'>_get</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='comment'># just get item
|
560
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid__set'>_set</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_values'>values</span> <span class='kw'>if</span> <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>></span> <span class='int'>1</span> <span class='comment'># set item to multiple values
|
561
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid__set'>_set</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='comment'># set item to single value
|
562
|
+
</span><span class='kw'>end</span></pre>
|
563
|
+
</td>
|
564
|
+
</tr>
|
565
|
+
</table>
|
566
|
+
</div>
|
567
|
+
|
568
|
+
</div>
|
569
|
+
|
570
|
+
<div id="instance_attr_details" class="attr_details">
|
571
|
+
<h2>Instance Attribute Details</h2>
|
572
|
+
|
573
|
+
|
574
|
+
<span id="_parent=-instance_method"></span>
|
575
|
+
<span id="_parent-instance_method"></span>
|
576
|
+
<div class="method_details first">
|
577
|
+
<h3 class="signature first" id="_parent-instance_method">
|
578
|
+
|
579
|
+
- (<tt>Object</tt>) <strong>_parent</strong>
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
</h3><div class="docstring">
|
586
|
+
<div class="discussion">
|
587
|
+
|
588
|
+
<p>Returns the value of attribute _parent</p>
|
589
|
+
|
590
|
+
|
591
|
+
</div>
|
592
|
+
</div>
|
593
|
+
<div class="tags">
|
594
|
+
|
595
|
+
|
596
|
+
</div><table class="source_code">
|
597
|
+
<tr>
|
598
|
+
<td>
|
599
|
+
<pre class="lines">
|
600
|
+
|
601
|
+
|
602
|
+
88
|
603
|
+
89
|
604
|
+
90</pre>
|
605
|
+
</td>
|
606
|
+
<td>
|
607
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 88</span>
|
608
|
+
|
609
|
+
<span class='kw'>def</span> <span class='id identifier rubyid__parent'>_parent</span>
|
610
|
+
<span class='ivar'>@_parent</span>
|
611
|
+
<span class='kw'>end</span></pre>
|
612
|
+
</td>
|
613
|
+
</tr>
|
614
|
+
</table>
|
615
|
+
</div>
|
616
|
+
|
617
|
+
</div>
|
618
|
+
|
619
|
+
|
620
|
+
<div id="class_method_details" class="method_details_list">
|
621
|
+
<h2>Class Method Details</h2>
|
622
|
+
|
623
|
+
|
624
|
+
<div class="method_details first">
|
625
|
+
<h3 class="signature first" id="load-class_method">
|
626
|
+
|
627
|
+
+ (<tt>Object</tt>) <strong>load</strong>(file)
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
</h3><div class="docstring">
|
634
|
+
<div class="discussion">
|
635
|
+
|
636
|
+
<p>Creates a new Configuration instance from filename or File/IO object.</p>
|
637
|
+
|
638
|
+
<p>Content should be in Eval DSL format.</p>
|
639
|
+
|
640
|
+
|
641
|
+
</div>
|
642
|
+
</div>
|
643
|
+
<div class="tags">
|
644
|
+
|
645
|
+
|
646
|
+
</div><table class="source_code">
|
647
|
+
<tr>
|
648
|
+
<td>
|
649
|
+
<pre class="lines">
|
650
|
+
|
651
|
+
|
652
|
+
40
|
653
|
+
41
|
654
|
+
42</pre>
|
655
|
+
</td>
|
656
|
+
<td>
|
657
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 40</span>
|
658
|
+
|
659
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='id identifier rubyid_file'>file</span>
|
660
|
+
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='op'>:</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_file'>file</span><span class='rparen'>)</span>
|
661
|
+
<span class='kw'>end</span></pre>
|
662
|
+
</td>
|
663
|
+
</tr>
|
664
|
+
</table>
|
665
|
+
</div>
|
666
|
+
|
667
|
+
<div class="method_details ">
|
668
|
+
<h3 class="signature " id="new_defer_block_for_parent-class_method">
|
669
|
+
|
670
|
+
+ (<tt>Object</tt>) <strong>new_defer_block_for_parent</strong>(parent, &block)
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
</h3><table class="source_code">
|
677
|
+
<tr>
|
678
|
+
<td>
|
679
|
+
<pre class="lines">
|
680
|
+
|
681
|
+
|
682
|
+
44
|
683
|
+
45
|
684
|
+
46
|
685
|
+
47
|
686
|
+
48
|
687
|
+
49
|
688
|
+
50
|
689
|
+
51
|
690
|
+
52
|
691
|
+
53</pre>
|
692
|
+
</td>
|
693
|
+
<td>
|
694
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 44</span>
|
695
|
+
|
696
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_defer_block_for_parent'>new_defer_block_for_parent</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
697
|
+
<span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
698
|
+
<span class='id identifier rubyid_conf'>conf</span><span class='period'>.</span><span class='id identifier rubyid__parent'>_parent</span> <span class='op'>=</span> <span class='id identifier rubyid_parent'>parent</span>
|
699
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>&&</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span> <span class='op'>==</span> <span class='int'>1</span>
|
700
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_conf'>conf</span><span class='rparen'>)</span> <span class='comment'># this is 'yield self' from the outside
|
701
|
+
</span> <span class='kw'>else</span>
|
702
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>WTF! expected a block with a single parameter</span><span class='tstring_end'>"</span></span>
|
703
|
+
<span class='kw'>end</span>
|
704
|
+
<span class='id identifier rubyid_conf'>conf</span>
|
705
|
+
<span class='kw'>end</span></pre>
|
706
|
+
</td>
|
707
|
+
</tr>
|
708
|
+
</table>
|
709
|
+
</div>
|
710
|
+
|
711
|
+
<div class="method_details ">
|
712
|
+
<h3 class="signature " id="read-class_method">
|
713
|
+
|
714
|
+
+ (<tt>Object</tt>) <strong>read</strong>(string)
|
715
|
+
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
|
720
|
+
</h3><div class="docstring">
|
721
|
+
<div class="discussion">
|
722
|
+
|
723
|
+
<p>Creates a new Configuration instance from string.</p>
|
724
|
+
|
725
|
+
<p>Content should be in Eval DSL format.</p>
|
726
|
+
|
727
|
+
|
728
|
+
</div>
|
729
|
+
</div>
|
730
|
+
<div class="tags">
|
731
|
+
|
732
|
+
|
733
|
+
</div><table class="source_code">
|
734
|
+
<tr>
|
735
|
+
<td>
|
736
|
+
<pre class="lines">
|
737
|
+
|
738
|
+
|
739
|
+
30
|
740
|
+
31
|
741
|
+
32
|
742
|
+
33
|
743
|
+
34</pre>
|
744
|
+
</td>
|
745
|
+
<td>
|
746
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 30</span>
|
747
|
+
|
748
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='id identifier rubyid_string'>string</span>
|
749
|
+
<span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
750
|
+
<span class='id identifier rubyid_conf'>conf</span><span class='period'>.</span><span class='id identifier rubyid_instance_eval'>instance_eval</span> <span class='id identifier rubyid_string'>string</span>
|
751
|
+
<span class='id identifier rubyid_conf'>conf</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
<div class="method_details ">
|
759
|
+
<h3 class="signature " id="version-class_method">
|
760
|
+
|
761
|
+
+ (<tt>Object</tt>) <strong>version</strong>
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
</h3><div class="docstring">
|
768
|
+
<div class="discussion">
|
769
|
+
|
770
|
+
<p>Returns Configuration version number.</p>
|
771
|
+
|
772
|
+
|
773
|
+
</div>
|
774
|
+
</div>
|
775
|
+
<div class="tags">
|
776
|
+
|
777
|
+
|
778
|
+
</div><table class="source_code">
|
779
|
+
<tr>
|
780
|
+
<td>
|
781
|
+
<pre class="lines">
|
782
|
+
|
783
|
+
|
784
|
+
22
|
785
|
+
23
|
786
|
+
24</pre>
|
787
|
+
</td>
|
788
|
+
<td>
|
789
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 22</span>
|
790
|
+
|
791
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
|
792
|
+
<span class='const'>VERSION</span>
|
793
|
+
<span class='kw'>end</span></pre>
|
794
|
+
</td>
|
795
|
+
</tr>
|
796
|
+
</table>
|
797
|
+
</div>
|
798
|
+
|
799
|
+
</div>
|
800
|
+
|
801
|
+
<div id="instance_method_details" class="method_details_list">
|
802
|
+
<h2>Instance Method Details</h2>
|
803
|
+
|
804
|
+
|
805
|
+
<div class="method_details first">
|
806
|
+
<h3 class="signature first" id="_get-instance_method">
|
807
|
+
|
808
|
+
- (<tt>Object</tt>) <strong>_get</strong>(key)
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
<span class="aliases">Also known as:
|
813
|
+
<span class="names"><span id='[]-instance_method'>[]</span></span>
|
814
|
+
</span>
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
</h3><div class="docstring">
|
819
|
+
<div class="discussion">
|
820
|
+
|
821
|
+
<p>Retrieves value for key, indifferent storage permits key to be a string or
|
822
|
+
symbol.</p>
|
823
|
+
|
824
|
+
<p>If configuration is nested, searches for key recursively up to root.</p>
|
825
|
+
|
826
|
+
<p>Returns nil if key does not exist.</p>
|
827
|
+
|
828
|
+
|
829
|
+
</div>
|
830
|
+
</div>
|
831
|
+
<div class="tags">
|
832
|
+
|
833
|
+
|
834
|
+
</div><table class="source_code">
|
835
|
+
<tr>
|
836
|
+
<td>
|
837
|
+
<pre class="lines">
|
838
|
+
|
839
|
+
|
840
|
+
106
|
841
|
+
107
|
842
|
+
108
|
843
|
+
109
|
844
|
+
110</pre>
|
845
|
+
</td>
|
846
|
+
<td>
|
847
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 106</span>
|
848
|
+
|
849
|
+
<span class='kw'>def</span> <span class='id identifier rubyid__get'>_get</span> <span class='id identifier rubyid_key'>key</span>
|
850
|
+
<span class='kw'>return</span> <span class='ivar'>@items</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='ivar'>@items</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
851
|
+
<span class='kw'>return</span> <span class='ivar'>@items</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid__parent'>_parent</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
852
|
+
<span class='id identifier rubyid__parent'>_parent</span><span class='period'>.</span><span class='id identifier rubyid__get'>_get</span> <span class='id identifier rubyid_key'>key</span>
|
853
|
+
<span class='kw'>end</span></pre>
|
854
|
+
</td>
|
855
|
+
</tr>
|
856
|
+
</table>
|
857
|
+
</div>
|
858
|
+
|
859
|
+
<div class="method_details ">
|
860
|
+
<h3 class="signature " id="_load-instance_method">
|
861
|
+
|
862
|
+
- (<tt>Object</tt>) <strong>_load</strong>(file)
|
863
|
+
|
864
|
+
|
865
|
+
|
866
|
+
|
867
|
+
|
868
|
+
</h3><table class="source_code">
|
869
|
+
<tr>
|
870
|
+
<td>
|
871
|
+
<pre class="lines">
|
872
|
+
|
873
|
+
|
874
|
+
117
|
875
|
+
118
|
876
|
+
119</pre>
|
877
|
+
</td>
|
878
|
+
<td>
|
879
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 117</span>
|
880
|
+
|
881
|
+
<span class='kw'>def</span> <span class='id identifier rubyid__load'>_load</span> <span class='id identifier rubyid_file'>file</span>
|
882
|
+
<span class='id identifier rubyid__read'>_read</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='op'>:</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_file'>file</span><span class='rparen'>)</span>
|
883
|
+
<span class='kw'>end</span></pre>
|
884
|
+
</td>
|
885
|
+
</tr>
|
886
|
+
</table>
|
887
|
+
</div>
|
888
|
+
|
889
|
+
<div class="method_details ">
|
890
|
+
<h3 class="signature " id="_read-instance_method">
|
891
|
+
|
892
|
+
- (<tt>Object</tt>) <strong>_read</strong>(string)
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
</h3><table class="source_code">
|
899
|
+
<tr>
|
900
|
+
<td>
|
901
|
+
<pre class="lines">
|
902
|
+
|
903
|
+
|
904
|
+
113
|
905
|
+
114
|
906
|
+
115</pre>
|
907
|
+
</td>
|
908
|
+
<td>
|
909
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 113</span>
|
910
|
+
|
911
|
+
<span class='kw'>def</span> <span class='id identifier rubyid__read'>_read</span> <span class='id identifier rubyid_string'>string</span>
|
912
|
+
<span class='id identifier rubyid_instance_eval'>instance_eval</span> <span class='id identifier rubyid_string'>string</span>
|
913
|
+
<span class='kw'>end</span></pre>
|
914
|
+
</td>
|
915
|
+
</tr>
|
916
|
+
</table>
|
917
|
+
</div>
|
918
|
+
|
919
|
+
<div class="method_details ">
|
920
|
+
<h3 class="signature " id="_set-instance_method">
|
921
|
+
|
922
|
+
- (<tt>Object</tt>) <strong>_set</strong>(key, value)
|
923
|
+
|
924
|
+
|
925
|
+
|
926
|
+
<span class="aliases">Also known as:
|
927
|
+
<span class="names"><span id='[]=-instance_method'>[]=</span></span>
|
928
|
+
</span>
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
</h3><table class="source_code">
|
933
|
+
<tr>
|
934
|
+
<td>
|
935
|
+
<pre class="lines">
|
936
|
+
|
937
|
+
|
938
|
+
90
|
939
|
+
91
|
940
|
+
92
|
941
|
+
93
|
942
|
+
94
|
943
|
+
95
|
944
|
+
96
|
945
|
+
97</pre>
|
946
|
+
</td>
|
947
|
+
<td>
|
948
|
+
<pre class="code"><span class="info file"># File 'lib/iqeo/configuration.rb', line 90</span>
|
949
|
+
|
950
|
+
<span class='kw'>def</span> <span class='id identifier rubyid__set'>_set</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
951
|
+
<span class='comment'># fix: extend parenting for enumerable with configurations at arbitrary depth
|
952
|
+
</span> <span class='kw'>case</span>
|
953
|
+
<span class='kw'>when</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span> <span class='const'>Configuration</span> <span class='rparen'>)</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid__parent'>_parent</span> <span class='op'>=</span> <span class='kw'>self</span>
|
954
|
+
<span class='kw'>when</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span> <span class='const'>Enumerable</span> <span class='rparen'>)</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid__parent'>_parent</span> <span class='op'>=</span> <span class='kw'>self</span> <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span> <span class='const'>Configuration</span> <span class='rbrace'>}</span>
|
955
|
+
<span class='kw'>end</span>
|
956
|
+
<span class='ivar'>@items</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
957
|
+
<span class='kw'>end</span></pre>
|
958
|
+
</td>
|
959
|
+
</tr>
|
960
|
+
</table>
|
961
|
+
</div>
|
962
|
+
|
963
|
+
</div>
|
964
|
+
|
965
|
+
</div>
|
966
|
+
|
967
|
+
<div id="footer">
|
968
|
+
Generated on Fri May 11 14:53:17 2012 by
|
969
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
970
|
+
0.8.1 (ruby-1.9.3).
|
971
|
+
</div>
|
972
|
+
|
973
|
+
</body>
|
974
|
+
</html>
|