mack-facets 0.6.1.1 → 0.6.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/doc/classes/Array.html +408 -0
  2. data/doc/classes/Class.html +233 -0
  3. data/doc/classes/Hash.html +233 -0
  4. data/doc/classes/Kernel.html +184 -0
  5. data/doc/classes/Mack/Utils/Inflector.html +382 -0
  6. data/doc/classes/Mack/Utils/RegistryList.html +469 -0
  7. data/doc/classes/Mack/Utils/RegistryMap.html +479 -0
  8. data/doc/classes/Math.html +188 -0
  9. data/doc/classes/Module.html +203 -0
  10. data/doc/classes/NilClass.html +148 -0
  11. data/doc/classes/Object.html +558 -0
  12. data/doc/classes/String.html +451 -0
  13. data/doc/classes/Symbol.html +148 -0
  14. data/doc/created.rid +1 -0
  15. data/doc/files/README.html +112 -0
  16. data/doc/files/lib/mack-facets/english_extensions/inflect_rb.html +101 -0
  17. data/doc/files/lib/mack-facets/english_extensions/numerals_rb.html +101 -0
  18. data/doc/files/lib/mack-facets/extensions/array_rb.html +101 -0
  19. data/doc/files/lib/mack-facets/extensions/class_rb.html +101 -0
  20. data/doc/files/lib/mack-facets/extensions/hash_rb.html +108 -0
  21. data/doc/files/lib/mack-facets/extensions/kernel_rb.html +109 -0
  22. data/doc/files/lib/mack-facets/extensions/math_rb.html +101 -0
  23. data/doc/files/lib/mack-facets/extensions/module_rb.html +101 -0
  24. data/doc/files/lib/mack-facets/extensions/nil_class_rb.html +101 -0
  25. data/doc/files/lib/mack-facets/extensions/object_rb.html +101 -0
  26. data/doc/files/lib/mack-facets/extensions/string_rb.html +101 -0
  27. data/doc/files/lib/mack-facets/extensions/symbol_rb.html +101 -0
  28. data/doc/files/lib/mack-facets/utils/inflections_rb.html +101 -0
  29. data/doc/files/lib/mack-facets/utils/inflector_rb.html +108 -0
  30. data/doc/files/lib/mack-facets/utils/options_merger_rb.html +101 -0
  31. data/doc/files/lib/mack-facets/utils/registry_list_rb.html +108 -0
  32. data/doc/files/lib/mack-facets/utils/registry_map_rb.html +108 -0
  33. data/doc/files/lib/mack-facets_rb.html +123 -0
  34. data/doc/fr_class_index.html +39 -0
  35. data/doc/fr_file_index.html +45 -0
  36. data/doc/fr_method_index.html +98 -0
  37. data/doc/index.html +24 -0
  38. data/doc/rdoc-style.css +208 -0
  39. metadata +40 -2
@@ -0,0 +1,479 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Mack::Utils::RegistryMap</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Mack::Utils::RegistryMap</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/mack-facets/utils/registry_map_rb.html">
59
+ lib/mack-facets/utils/registry_map.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="../../Object.html">
69
+ Object
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ Provides a convenient way to register items in a map.
86
+ </p>
87
+ <p>
88
+ The structure of the registry is { :tag =&gt; [content] }, and the items
89
+ within the array can be arranged anyway the user sees fit.
90
+ </p>
91
+ <p>
92
+ ds - july 2008
93
+ </p>
94
+
95
+ </div>
96
+
97
+
98
+ </div>
99
+
100
+ <div id="method-list">
101
+ <h3 class="section-bar">Methods</h3>
102
+
103
+ <div class="name-list">
104
+ <a href="#M000048">add</a>&nbsp;&nbsp;
105
+ <a href="#M000053">add</a>&nbsp;&nbsp;
106
+ <a href="#M000051">clear!</a>&nbsp;&nbsp;
107
+ <a href="#M000046">initial_state</a>&nbsp;&nbsp;
108
+ <a href="#M000056">move_to_bottom</a>&nbsp;&nbsp;
109
+ <a href="#M000055">move_to_top</a>&nbsp;&nbsp;
110
+ <a href="#M000050">registered_items</a>&nbsp;&nbsp;
111
+ <a href="#M000049">remove</a>&nbsp;&nbsp;
112
+ <a href="#M000054">remove</a>&nbsp;&nbsp;
113
+ <a href="#M000052">reset!</a>&nbsp;&nbsp;
114
+ <a href="#M000047">reset!</a>&nbsp;&nbsp;
115
+ </div>
116
+ </div>
117
+
118
+ </div>
119
+
120
+
121
+ <!-- if includes -->
122
+ <div id="includes">
123
+ <h3 class="section-bar">Included Modules</h3>
124
+
125
+ <div id="includes-list">
126
+ <span class="include-name">Singleton</span>
127
+ <span class="include-name">Extlib::Hook</span>
128
+ </div>
129
+ </div>
130
+
131
+ <div id="section">
132
+
133
+
134
+
135
+
136
+
137
+ <div id="attribute-list">
138
+ <h3 class="section-bar">Attributes</h3>
139
+
140
+ <div class="name-list">
141
+ <table>
142
+ <tr class="top-aligned-row context-row">
143
+ <td class="context-item-name">registered_items</td>
144
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
145
+ <td class="context-item-desc">
146
+ The list of registered items
147
+
148
+ </td>
149
+ </tr>
150
+ </table>
151
+ </div>
152
+ </div>
153
+
154
+
155
+
156
+ <!-- if method_list -->
157
+ <div id="methods">
158
+ <h3 class="section-bar">Public Class methods</h3>
159
+
160
+ <div id="method-M000053" class="method-detail">
161
+ <a name="M000053"></a>
162
+
163
+ <div class="method-heading">
164
+ <a href="#M000053" class="method-signature">
165
+ <span class="method-name">add</span><span class="method-args">(tag, klass, position = -1)</span>
166
+ </a>
167
+ </div>
168
+
169
+ <div class="method-description">
170
+ <p>
171
+ Adds an object to the list at a specified position. By default the position
172
+ is last.
173
+ </p>
174
+ <p><a class="source-toggle" href="#"
175
+ onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
176
+ <div class="method-source-code" id="M000053-source">
177
+ <pre>
178
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 70</span>
179
+ 70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">position</span> = <span class="ruby-value">-1</span>)
180
+ 71: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">position</span>)
181
+ 72: <span class="ruby-keyword kw">end</span>
182
+ </pre>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div id="method-M000051" class="method-detail">
188
+ <a name="M000051"></a>
189
+
190
+ <div class="method-heading">
191
+ <a href="#M000051" class="method-signature">
192
+ <span class="method-name">clear!</span><span class="method-args">()</span>
193
+ </a>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+ <p>
198
+ Emptys out the list of <a
199
+ href="RegistryMap.html#M000050">registered_items</a>.
200
+ </p>
201
+ <p><a class="source-toggle" href="#"
202
+ onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
203
+ <div class="method-source-code" id="M000051-source">
204
+ <pre>
205
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 60</span>
206
+ 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear!</span>
207
+ 61: <span class="ruby-identifier">registered_items</span>.<span class="ruby-identifier">clear</span>
208
+ 62: <span class="ruby-keyword kw">end</span>
209
+ </pre>
210
+ </div>
211
+ </div>
212
+ </div>
213
+
214
+ <div id="method-M000056" class="method-detail">
215
+ <a name="M000056"></a>
216
+
217
+ <div class="method-heading">
218
+ <a href="#M000056" class="method-signature">
219
+ <span class="method-name">move_to_bottom</span><span class="method-args">(tag, klass)</span>
220
+ </a>
221
+ </div>
222
+
223
+ <div class="method-description">
224
+ <p>
225
+ Moves an object to the bottom of the <a
226
+ href="RegistryMap.html#M000050">registered_items</a> list.
227
+ </p>
228
+ <p><a class="source-toggle" href="#"
229
+ onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
230
+ <div class="method-source-code" id="M000056-source">
231
+ <pre>
232
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 85</span>
233
+ 85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_to_bottom</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
234
+ 86: <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
235
+ 87: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
236
+ 88: <span class="ruby-keyword kw">end</span>
237
+ </pre>
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+ <div id="method-M000055" class="method-detail">
243
+ <a name="M000055"></a>
244
+
245
+ <div class="method-heading">
246
+ <a href="#M000055" class="method-signature">
247
+ <span class="method-name">move_to_top</span><span class="method-args">(tag, klass)</span>
248
+ </a>
249
+ </div>
250
+
251
+ <div class="method-description">
252
+ <p>
253
+ Moves an object to the top of the <a
254
+ href="RegistryMap.html#M000050">registered_items</a> list.
255
+ </p>
256
+ <p><a class="source-toggle" href="#"
257
+ onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
258
+ <div class="method-source-code" id="M000055-source">
259
+ <pre>
260
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 80</span>
261
+ 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_to_top</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
262
+ 81: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-value">0</span>)
263
+ 82: <span class="ruby-keyword kw">end</span>
264
+ </pre>
265
+ </div>
266
+ </div>
267
+ </div>
268
+
269
+ <div id="method-M000050" class="method-detail">
270
+ <a name="M000050"></a>
271
+
272
+ <div class="method-heading">
273
+ <a href="#M000050" class="method-signature">
274
+ <span class="method-name">registered_items</span><span class="method-args">()</span>
275
+ </a>
276
+ </div>
277
+
278
+ <div class="method-description">
279
+ <p>
280
+ Returns the list of registered items.
281
+ </p>
282
+ <p><a class="source-toggle" href="#"
283
+ onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
284
+ <div class="method-source-code" id="M000050-source">
285
+ <pre>
286
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 55</span>
287
+ 55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">registered_items</span>
288
+ 56: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">registered_items</span>
289
+ 57: <span class="ruby-keyword kw">end</span>
290
+ </pre>
291
+ </div>
292
+ </div>
293
+ </div>
294
+
295
+ <div id="method-M000054" class="method-detail">
296
+ <a name="M000054"></a>
297
+
298
+ <div class="method-heading">
299
+ <a href="#M000054" class="method-signature">
300
+ <span class="method-name">remove</span><span class="method-args">(tag, klass)</span>
301
+ </a>
302
+ </div>
303
+
304
+ <div class="method-description">
305
+ <p>
306
+ Removes an object from the list.
307
+ </p>
308
+ <p><a class="source-toggle" href="#"
309
+ onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
310
+ <div class="method-source-code" id="M000054-source">
311
+ <pre>
312
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 75</span>
313
+ 75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
314
+ 76: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">remove</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
315
+ 77: <span class="ruby-keyword kw">end</span>
316
+ </pre>
317
+ </div>
318
+ </div>
319
+ </div>
320
+
321
+ <div id="method-M000052" class="method-detail">
322
+ <a name="M000052"></a>
323
+
324
+ <div class="method-heading">
325
+ <a href="#M000052" class="method-signature">
326
+ <span class="method-name">reset!</span><span class="method-args">()</span>
327
+ </a>
328
+ </div>
329
+
330
+ <div class="method-description">
331
+ <p>
332
+ Resets the <a href="RegistryMap.html#M000050">registered_items</a> list to
333
+ the list specified by the <a
334
+ href="RegistryMap.html#M000046">initial_state</a> method.
335
+ </p>
336
+ <p><a class="source-toggle" href="#"
337
+ onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
338
+ <div class="method-source-code" id="M000052-source">
339
+ <pre>
340
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 65</span>
341
+ 65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
342
+ 66: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">reset!</span>
343
+ 67: <span class="ruby-keyword kw">end</span>
344
+ </pre>
345
+ </div>
346
+ </div>
347
+ </div>
348
+
349
+ <h3 class="section-bar">Public Instance methods</h3>
350
+
351
+ <div id="method-M000048" class="method-detail">
352
+ <a name="M000048"></a>
353
+
354
+ <div class="method-heading">
355
+ <a href="#M000048" class="method-signature">
356
+ <span class="method-name">add</span><span class="method-args">(tag, klass, position = -1)</span>
357
+ </a>
358
+ </div>
359
+
360
+ <div class="method-description">
361
+ <p>
362
+ Adds an object to the list at a specified position. By default the position
363
+ is last.
364
+ </p>
365
+ <p><a class="source-toggle" href="#"
366
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
367
+ <div class="method-source-code" id="M000048-source">
368
+ <pre>
369
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 36</span>
370
+ 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">position</span> = <span class="ruby-value">-1</span>)
371
+ 37: <span class="ruby-ivar">@registered_items</span>[<span class="ruby-identifier">tag</span>] <span class="ruby-operator">||=</span> []
372
+ 38: <span class="ruby-identifier">arr</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">registered_items</span>[<span class="ruby-identifier">tag</span>]
373
+ 39: <span class="ruby-identifier">position</span> = <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">position</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span>
374
+ 40:
375
+ 41: <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">position</span>, <span class="ruby-identifier">klass</span>)
376
+ 42: <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">uniq!</span>
377
+ 43: <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">compact!</span>
378
+ 44: <span class="ruby-keyword kw">end</span>
379
+ </pre>
380
+ </div>
381
+ </div>
382
+ </div>
383
+
384
+ <div id="method-M000046" class="method-detail">
385
+ <a name="M000046"></a>
386
+
387
+ <div class="method-heading">
388
+ <a href="#M000046" class="method-signature">
389
+ <span class="method-name">initial_state</span><span class="method-args">()</span>
390
+ </a>
391
+ </div>
392
+
393
+ <div class="method-description">
394
+ <p>
395
+ Override this method to set the initial state of the <a
396
+ href="RegistryMap.html#M000050">registered_items</a> <a
397
+ href="../../Array.html">Array</a>. By default this list is empty.
398
+ </p>
399
+ <p><a class="source-toggle" href="#"
400
+ onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
401
+ <div class="method-source-code" id="M000046-source">
402
+ <pre>
403
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 26</span>
404
+ 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initial_state</span>
405
+ 27: {}
406
+ 28: <span class="ruby-keyword kw">end</span>
407
+ </pre>
408
+ </div>
409
+ </div>
410
+ </div>
411
+
412
+ <div id="method-M000049" class="method-detail">
413
+ <a name="M000049"></a>
414
+
415
+ <div class="method-heading">
416
+ <a href="#M000049" class="method-signature">
417
+ <span class="method-name">remove</span><span class="method-args">(tag, klass)</span>
418
+ </a>
419
+ </div>
420
+
421
+ <div class="method-description">
422
+ <p>
423
+ Removes an object from the list.
424
+ </p>
425
+ <p><a class="source-toggle" href="#"
426
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
427
+ <div class="method-source-code" id="M000049-source">
428
+ <pre>
429
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 47</span>
430
+ 47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">klass</span>)
431
+ 48: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@registered_items</span>[<span class="ruby-identifier">tag</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
432
+ 49: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">registered_items</span>[<span class="ruby-identifier">tag</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">klass</span>)
433
+ 50: <span class="ruby-keyword kw">end</span>
434
+ </pre>
435
+ </div>
436
+ </div>
437
+ </div>
438
+
439
+ <div id="method-M000047" class="method-detail">
440
+ <a name="M000047"></a>
441
+
442
+ <div class="method-heading">
443
+ <a href="#M000047" class="method-signature">
444
+ <span class="method-name">reset!</span><span class="method-args">()</span>
445
+ </a>
446
+ </div>
447
+
448
+ <div class="method-description">
449
+ <p>
450
+ Resets the <a href="RegistryMap.html#M000050">registered_items</a> list to
451
+ the list specified by the <a
452
+ href="RegistryMap.html#M000046">initial_state</a> method.
453
+ </p>
454
+ <p><a class="source-toggle" href="#"
455
+ onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
456
+ <div class="method-source-code" id="M000047-source">
457
+ <pre>
458
+ <span class="ruby-comment cmt"># File lib/mack-facets/utils/registry_map.rb, line 31</span>
459
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
460
+ 32: <span class="ruby-ivar">@registered_items</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">initial_state</span>.<span class="ruby-identifier">dup</span>
461
+ 33: <span class="ruby-keyword kw">end</span>
462
+ </pre>
463
+ </div>
464
+ </div>
465
+ </div>
466
+
467
+
468
+ </div>
469
+
470
+
471
+ </div>
472
+
473
+
474
+ <div id="validator-badges">
475
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
476
+ </div>
477
+
478
+ </body>
479
+ </html>