binaryparse 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/binaryparse.gemspec +17 -17
  2. data/examples/pms_input_2_test.rb +70 -0
  3. data/lib/blocker.rb +1 -1
  4. metadata +3 -66
  5. data/doc/binaryparse.chm +0 -0
  6. data/doc/bphelp.zip +0 -0
  7. data/doc/classes/BinaryBlocker/BitFieldEncoder.html +0 -328
  8. data/doc/classes/BinaryBlocker/Blocker.html +0 -168
  9. data/doc/classes/BinaryBlocker/CountedArrayEncoder.html +0 -347
  10. data/doc/classes/BinaryBlocker/Encoder.html +0 -526
  11. data/doc/classes/BinaryBlocker/FixedArrayEncoder.html +0 -278
  12. data/doc/classes/BinaryBlocker/FixedStringEncoder.html +0 -177
  13. data/doc/classes/BinaryBlocker/FixedUTF16StringEncoder.html +0 -229
  14. data/doc/classes/BinaryBlocker/GroupEncoder.html +0 -650
  15. data/doc/classes/BinaryBlocker/ListOfEncoder.html +0 -343
  16. data/doc/classes/BinaryBlocker/OneOfEncoder.html +0 -306
  17. data/doc/classes/BinaryBlocker/PackedDateEncoder.html +0 -220
  18. data/doc/classes/BinaryBlocker/PackedDateTimeEncoder.html +0 -220
  19. data/doc/classes/BinaryBlocker/PackedNumberEncoder.html +0 -231
  20. data/doc/classes/BinaryBlocker/SimpleEncoder.html +0 -284
  21. data/doc/classes/BinaryBlocker.html +0 -329
  22. data/doc/classes/BufferedIO.html +0 -324
  23. data/doc/classes/TestBlocker/BBDate.html +0 -120
  24. data/doc/classes/TestBlocker/BBList.html +0 -120
  25. data/doc/classes/TestBlocker/BBPacked.html +0 -120
  26. data/doc/classes/TestBlocker/BBString.html +0 -120
  27. data/doc/classes/TestBlocker/BBSub1.html +0 -120
  28. data/doc/classes/TestBlocker/BBSub2.html +0 -120
  29. data/doc/classes/TestBlocker/BBTest1.html +0 -120
  30. data/doc/classes/TestBlocker/BBTest2.html +0 -120
  31. data/doc/classes/TestBlocker/BBTest3.html +0 -120
  32. data/doc/classes/TestBlocker/BBTest4.html +0 -120
  33. data/doc/classes/TestBlocker/BBTest5.html +0 -120
  34. data/doc/classes/TestBlocker/BBTest6.html +0 -120
  35. data/doc/classes/TestBlocker/BBTest7.html +0 -120
  36. data/doc/classes/TestBlocker/BBTime.html +0 -120
  37. data/doc/classes/TestBlocker/BBUTF16.html +0 -120
  38. data/doc/classes/TestBlocker/ItemA.html +0 -120
  39. data/doc/classes/TestBlocker/ItemB.html +0 -120
  40. data/doc/classes/TestBlocker.html +0 -802
  41. data/doc/contents.hhc +0 -670
  42. data/doc/created.rid +0 -1
  43. data/doc/dot/f_0.dot +0 -208
  44. data/doc/dot/f_0.png +0 -0
  45. data/doc/dot/f_1.dot +0 -23
  46. data/doc/dot/f_1.png +0 -0
  47. data/doc/dot/f_2.dot +0 -32
  48. data/doc/dot/f_2.png +0 -0
  49. data/doc/dot/m_0_0.dot +0 -208
  50. data/doc/dot/m_0_0.png +0 -0
  51. data/doc/files/lib/blocker_rb.html +0 -144
  52. data/doc/files/lib/buffered_io_rb.html +0 -115
  53. data/doc/files/test/test_blocker_rb.html +0 -116
  54. data/doc/fr_class_index.html +0 -60
  55. data/doc/fr_file_index.html +0 -29
  56. data/doc/fr_method_index.html +0 -135
  57. data/doc/index.hhk +0 -599
  58. data/doc/index.html +0 -24
  59. data/doc/rdoc-style.css +0 -208
  60. data/doc/rdoc.hhp +0 -15
@@ -1,650 +0,0 @@
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: BinaryBlocker::GroupEncoder</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">BinaryBlocker::GroupEncoder</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/blocker_rb.html">
59
- lib/blocker.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="Encoder.html">
69
- Encoder
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
- <div id="diagram">
83
- <map id="map" name="map">
84
- <area shape="rect" coords="252,146,351,194" href="GroupEncoder.html" alt="GroupEncoder" />
85
- <area shape="rect" coords="27,242,123,290" href="ListOfEncoder.html" alt="ListOfEncoder" />
86
- <area shape="rect" coords="147,242,219,290" href="Blocker.html" alt="Blocker" />
87
- <area shape="rect" coords="243,242,360,290" href="FixedArrayEncoder.html" alt="FixedArrayEncoder" />
88
- <area shape="rect" coords="384,242,517,290" href="CountedArrayEncoder.html" alt="CountedArrayEncoder" />
89
- <area shape="rect" coords="683,50,755,98" href="Encoder.html" alt="Encoder" />
90
- <area shape="rect" coords="605,146,707,194" href="SimpleEncoder.html" alt="SimpleEncoder" />
91
- <area shape="rect" coords="731,146,835,194" href="BitFieldEncoder.html" alt="BitFieldEncoder" />
92
- <area shape="rect" coords="859,146,960,194" href="OneOfEncoder.html" alt="OneOfEncoder" />
93
- <area shape="rect" coords="541,242,683,290" href="PackedNumberEncoder.html" alt="PackedNumberEncoder" />
94
- <area shape="rect" coords="469,338,595,386" href="PackedDateEncoder.html" alt="PackedDateEncoder" />
95
- <area shape="rect" coords="619,338,765,386" href="PackedDateTimeEncoder.html" alt="PackedDateTimeEncoder" />
96
- <area shape="rect" coords="707,242,827,290" href="FixedStringEncoder.html" alt="FixedStringEncoder" />
97
- <area shape="rect" coords="851,242,1005,290" href="FixedUTF16StringEncoder.html" alt="FixedUTF16StringEncoder" />
98
- <area shape="rect" coords="16,16,1016,396" href="../BinaryBlocker.html" alt="BinaryBlocker" />
99
- </map>
100
- <img src="../../dot/m_0_0.png" usemap="#map" border="0" alt="Module: BinaryBlocker" />
101
- </div>
102
-
103
- <div id="description">
104
- <p>
105
- All Encoders that store multiple items subclass from here.
106
- </p>
107
-
108
- </div>
109
-
110
-
111
- </div>
112
-
113
- <div id="method-list">
114
- <h3 class="section-bar">Methods</h3>
115
-
116
- <div class="name-list">
117
- <a href="#M000046">attributes</a>&nbsp;&nbsp;
118
- <a href="#M000049">block</a>&nbsp;&nbsp;
119
- <a href="#M000045">clear_registered_klasses</a>&nbsp;&nbsp;
120
- <a href="#M000050">deblock</a>&nbsp;&nbsp;
121
- <a href="#M000042">has_bit_field</a>&nbsp;&nbsp;
122
- <a href="#M000040">has_counted_array</a>&nbsp;&nbsp;
123
- <a href="#M000041">has_fixed_array</a>&nbsp;&nbsp;
124
- <a href="#M000043">has_list_of</a>&nbsp;&nbsp;
125
- <a href="#M000037">has_one</a>&nbsp;&nbsp;
126
- <a href="#M000039">has_one_of</a>&nbsp;&nbsp;
127
- <a href="#M000038">include_klasses</a>&nbsp;&nbsp;
128
- <a href="#M000036">inherited</a>&nbsp;&nbsp;
129
- <a href="#M000047">lookup</a>&nbsp;&nbsp;
130
- <a href="#M000051">method_missing</a>&nbsp;&nbsp;
131
- <a href="#M000048">new</a>&nbsp;&nbsp;
132
- <a href="#M000044">register_klass</a>&nbsp;&nbsp;
133
- <a href="#M000054">valid?</a>&nbsp;&nbsp;
134
- <a href="#M000052">value</a>&nbsp;&nbsp;
135
- <a href="#M000053">value=</a>&nbsp;&nbsp;
136
- </div>
137
- </div>
138
-
139
- </div>
140
-
141
-
142
- <!-- if includes -->
143
-
144
- <div id="section">
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- <!-- if method_list -->
154
- <div id="methods">
155
- <h3 class="section-bar">Public Class methods</h3>
156
-
157
- <div id="method-M000046" class="method-detail">
158
- <a name="M000046"></a>
159
-
160
- <div class="method-heading">
161
- <a href="#M000046" class="method-signature">
162
- <span class="method-name">attributes</span><span class="method-args">()</span>
163
- </a>
164
- </div>
165
-
166
- <div class="method-description">
167
- <p><a class="source-toggle" href="#"
168
- onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
169
- <div class="method-source-code" id="M000046-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 279</span>
172
- 279: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attributes</span>
173
- 280: <span class="ruby-ivar">@attributes</span>
174
- 281: <span class="ruby-keyword kw">end</span>
175
- </pre>
176
- </div>
177
- </div>
178
- </div>
179
-
180
- <div id="method-M000045" class="method-detail">
181
- <a name="M000045"></a>
182
-
183
- <div class="method-heading">
184
- <a href="#M000045" class="method-signature">
185
- <span class="method-name">clear_registered_klasses</span><span class="method-args">()</span>
186
- </a>
187
- </div>
188
-
189
- <div class="method-description">
190
- <p><a class="source-toggle" href="#"
191
- onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
192
- <div class="method-source-code" id="M000045-source">
193
- <pre>
194
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 275</span>
195
- 275: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_registered_klasses</span>
196
- 276: <span class="ruby-ivar">@klasses</span> = {}
197
- 277: <span class="ruby-keyword kw">end</span>
198
- </pre>
199
- </div>
200
- </div>
201
- </div>
202
-
203
- <div id="method-M000042" class="method-detail">
204
- <a name="M000042"></a>
205
-
206
- <div class="method-heading">
207
- <a href="#M000042" class="method-signature">
208
- <span class="method-name">has_bit_field</span><span class="method-args">(sym, type, bit_info, *opts)</span>
209
- </a>
210
- </div>
211
-
212
- <div class="method-description">
213
- <p><a class="source-toggle" href="#"
214
- onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
215
- <div class="method-source-code" id="M000042-source">
216
- <pre>
217
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 259</span>
218
- 259: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_bit_field</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">bit_info</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
219
- 260: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
220
- 261: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">BitFieldEncoder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">bit_info</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
221
- 262: <span class="ruby-keyword kw">end</span>
222
- </pre>
223
- </div>
224
- </div>
225
- </div>
226
-
227
- <div id="method-M000040" class="method-detail">
228
- <a name="M000040"></a>
229
-
230
- <div class="method-heading">
231
- <a href="#M000040" class="method-signature">
232
- <span class="method-name">has_counted_array</span><span class="method-args">(sym, count_type, klasses, *opts)</span>
233
- </a>
234
- </div>
235
-
236
- <div class="method-description">
237
- <p><a class="source-toggle" href="#"
238
- onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
239
- <div class="method-source-code" id="M000040-source">
240
- <pre>
241
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 247</span>
242
- 247: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_counted_array</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">count_type</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
243
- 248: <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">include_klasses</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
244
- 249: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
245
- 250: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">CountedArrayEncoder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">count_type</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
246
- 251: <span class="ruby-keyword kw">end</span>
247
- </pre>
248
- </div>
249
- </div>
250
- </div>
251
-
252
- <div id="method-M000041" class="method-detail">
253
- <a name="M000041"></a>
254
-
255
- <div class="method-heading">
256
- <a href="#M000041" class="method-signature">
257
- <span class="method-name">has_fixed_array</span><span class="method-args">(sym, count, klasses, *opts)</span>
258
- </a>
259
- </div>
260
-
261
- <div class="method-description">
262
- <p><a class="source-toggle" href="#"
263
- onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
264
- <div class="method-source-code" id="M000041-source">
265
- <pre>
266
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 253</span>
267
- 253: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_fixed_array</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">count</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
268
- 254: <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">include_klasses</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
269
- 255: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
270
- 256: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">FixedArrayEncoder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">count</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
271
- 257: <span class="ruby-keyword kw">end</span>
272
- </pre>
273
- </div>
274
- </div>
275
- </div>
276
-
277
- <div id="method-M000043" class="method-detail">
278
- <a name="M000043"></a>
279
-
280
- <div class="method-heading">
281
- <a href="#M000043" class="method-signature">
282
- <span class="method-name">has_list_of</span><span class="method-args">(sym, klasses, *opts)</span>
283
- </a>
284
- </div>
285
-
286
- <div class="method-description">
287
- <p><a class="source-toggle" href="#"
288
- onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
289
- <div class="method-source-code" id="M000043-source">
290
- <pre>
291
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 264</span>
292
- 264: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_list_of</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
293
- 265: <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">include_klasses</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
294
- 266: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
295
- 267: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">ListOfEncoder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
296
- 268: <span class="ruby-keyword kw">end</span>
297
- </pre>
298
- </div>
299
- </div>
300
- </div>
301
-
302
- <div id="method-M000037" class="method-detail">
303
- <a name="M000037"></a>
304
-
305
- <div class="method-heading">
306
- <a href="#M000037" class="method-signature">
307
- <span class="method-name">has_one</span><span class="method-args">(sym, klass, *opts)</span>
308
- </a>
309
- </div>
310
-
311
- <div class="method-description">
312
- <p>
313
- One and only one (this is the easiest :-)
314
- </p>
315
- <p><a class="source-toggle" href="#"
316
- onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
317
- <div class="method-source-code" id="M000037-source">
318
- <pre>
319
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 224</span>
320
- 224: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_one</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
321
- 225: <span class="ruby-identifier">klass</span> = <span class="ruby-ivar">@klasses</span>[<span class="ruby-identifier">klass</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@klasses</span>[<span class="ruby-identifier">klass</span>]
322
- 226: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
323
- 227: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
324
- 228: <span class="ruby-keyword kw">end</span>
325
- </pre>
326
- </div>
327
- </div>
328
- </div>
329
-
330
- <div id="method-M000039" class="method-detail">
331
- <a name="M000039"></a>
332
-
333
- <div class="method-heading">
334
- <a href="#M000039" class="method-signature">
335
- <span class="method-name">has_one_of</span><span class="method-args">(sym, klasses, *opts)</span>
336
- </a>
337
- </div>
338
-
339
- <div class="method-description">
340
- <p><a class="source-toggle" href="#"
341
- onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
342
- <div class="method-source-code" id="M000039-source">
343
- <pre>
344
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 241</span>
345
- 241: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_one_of</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
346
- 242: <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">include_klasses</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
347
- 243: <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">size</span>
348
- 244: <span class="ruby-ivar">@attributes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">OneOfEncoder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
349
- 245: <span class="ruby-keyword kw">end</span>
350
- </pre>
351
- </div>
352
- </div>
353
- </div>
354
-
355
- <div id="method-M000038" class="method-detail">
356
- <a name="M000038"></a>
357
-
358
- <div class="method-heading">
359
- <a href="#M000038" class="method-signature">
360
- <span class="method-name">include_klasses</span><span class="method-args">(klasses, *opts)</span>
361
- </a>
362
- </div>
363
-
364
- <div class="method-description">
365
- <p><a class="source-toggle" href="#"
366
- onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
367
- <div class="method-source-code" id="M000038-source">
368
- <pre>
369
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 230</span>
370
- 230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include_klasses</span>(<span class="ruby-identifier">klasses</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
371
- 231: <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">klasses</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
372
- 232: <span class="ruby-keyword kw">case</span>
373
- 233: <span class="ruby-keyword kw">when</span> <span class="ruby-ivar">@klasses</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-ivar">@klasses</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
374
- 234: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:call</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">k</span>
375
- 235: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:new</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">k</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>) }
376
- 236: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unable to process class: #{k}&quot;</span>
377
- 237: <span class="ruby-keyword kw">end</span>
378
- 238: <span class="ruby-keyword kw">end</span>
379
- 239: <span class="ruby-keyword kw">end</span>
380
- </pre>
381
- </div>
382
- </div>
383
- </div>
384
-
385
- <div id="method-M000036" class="method-detail">
386
- <a name="M000036"></a>
387
-
388
- <div class="method-heading">
389
- <a href="#M000036" class="method-signature">
390
- <span class="method-name">inherited</span><span class="method-args">(obj)</span>
391
- </a>
392
- </div>
393
-
394
- <div class="method-description">
395
- <p><a class="source-toggle" href="#"
396
- onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
397
- <div class="method-source-code" id="M000036-source">
398
- <pre>
399
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 214</span>
400
- 214: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">obj</span>)
401
- 215: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword kw">do</span>
402
- 216: <span class="ruby-ivar">@klasses</span> = <span class="ruby-constant">BinaryBlocker</span>.<span class="ruby-identifier">klasses</span>.<span class="ruby-identifier">clone</span>
403
- 217: <span class="ruby-ivar">@attributes</span> = []
404
- 218: <span class="ruby-ivar">@lookup</span> = {}
405
- 219: <span class="ruby-keyword kw">end</span>
406
- 220: <span class="ruby-keyword kw">super</span>
407
- 221: <span class="ruby-keyword kw">end</span>
408
- </pre>
409
- </div>
410
- </div>
411
- </div>
412
-
413
- <div id="method-M000047" class="method-detail">
414
- <a name="M000047"></a>
415
-
416
- <div class="method-heading">
417
- <a href="#M000047" class="method-signature">
418
- <span class="method-name">lookup</span><span class="method-args">()</span>
419
- </a>
420
- </div>
421
-
422
- <div class="method-description">
423
- <p><a class="source-toggle" href="#"
424
- onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
425
- <div class="method-source-code" id="M000047-source">
426
- <pre>
427
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 283</span>
428
- 283: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup</span>
429
- 284: <span class="ruby-ivar">@lookup</span>
430
- 285: <span class="ruby-keyword kw">end</span>
431
- </pre>
432
- </div>
433
- </div>
434
- </div>
435
-
436
- <div id="method-M000048" class="method-detail">
437
- <a name="M000048"></a>
438
-
439
- <div class="method-heading">
440
- <a href="#M000048" class="method-signature">
441
- <span class="method-name">new</span><span class="method-args">(*opts)</span>
442
- </a>
443
- </div>
444
-
445
- <div class="method-description">
446
- <p><a class="source-toggle" href="#"
447
- onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
448
- <div class="method-source-code" id="M000048-source">
449
- <pre>
450
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 288</span>
451
- 288: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>)
452
- 289: <span class="ruby-ivar">@lookup</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">lookup</span>.<span class="ruby-identifier">clone</span>
453
- 290: <span class="ruby-ivar">@value</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">call</span> }
454
- 291: <span class="ruby-keyword kw">super</span>
455
- 292: <span class="ruby-keyword kw">end</span>
456
- </pre>
457
- </div>
458
- </div>
459
- </div>
460
-
461
- <div id="method-M000044" class="method-detail">
462
- <a name="M000044"></a>
463
-
464
- <div class="method-heading">
465
- <a href="#M000044" class="method-signature">
466
- <span class="method-name">register_klass</span><span class="method-args">(sym, klass)</span>
467
- </a>
468
- </div>
469
-
470
- <div class="method-description">
471
- <p><a class="source-toggle" href="#"
472
- onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
473
- <div class="method-source-code" id="M000044-source">
474
- <pre>
475
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 270</span>
476
- 270: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register_klass</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">klass</span>)
477
- 271: <span class="ruby-ivar">@klasses</span> <span class="ruby-operator">||=</span> {}
478
- 272: <span class="ruby-ivar">@klasses</span>[<span class="ruby-identifier">sym</span>] = <span class="ruby-identifier">klass</span>
479
- 273: <span class="ruby-keyword kw">end</span>
480
- </pre>
481
- </div>
482
- </div>
483
- </div>
484
-
485
- <h3 class="section-bar">Public Instance methods</h3>
486
-
487
- <div id="method-M000049" class="method-detail">
488
- <a name="M000049"></a>
489
-
490
- <div class="method-heading">
491
- <a href="#M000049" class="method-signature">
492
- <span class="method-name">block</span><span class="method-args">()</span>
493
- </a>
494
- </div>
495
-
496
- <div class="method-description">
497
- <p><a class="source-toggle" href="#"
498
- onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
499
- <div class="method-source-code" id="M000049-source">
500
- <pre>
501
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 294</span>
502
- 294: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">block</span>
503
- 295: <span class="ruby-ivar">@value</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value str">&quot;&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">block</span> }
504
- 296: <span class="ruby-keyword kw">end</span>
505
- </pre>
506
- </div>
507
- </div>
508
- </div>
509
-
510
- <div id="method-M000050" class="method-detail">
511
- <a name="M000050"></a>
512
-
513
- <div class="method-heading">
514
- <a href="#M000050" class="method-signature">
515
- <span class="method-name">deblock</span><span class="method-args">(io)</span>
516
- </a>
517
- </div>
518
-
519
- <div class="method-description">
520
- <p><a class="source-toggle" href="#"
521
- onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
522
- <div class="method-source-code" id="M000050-source">
523
- <pre>
524
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 298</span>
525
- 298: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deblock</span>(<span class="ruby-identifier">io</span>)
526
- 299: <span class="ruby-constant">BinaryBlocker</span>.<span class="ruby-identifier">with_guarded_io_pos</span>(<span class="ruby-identifier">io</span>) <span class="ruby-keyword kw">do</span>
527
- 300: <span class="ruby-ivar">@value</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">deblock</span>(<span class="ruby-identifier">io</span>) }
528
- 301: <span class="ruby-keyword kw">end</span>
529
- 302: <span class="ruby-keyword kw">end</span>
530
- </pre>
531
- </div>
532
- </div>
533
- </div>
534
-
535
- <div id="method-M000051" class="method-detail">
536
- <a name="M000051"></a>
537
-
538
- <div class="method-heading">
539
- <a href="#M000051" class="method-signature">
540
- <span class="method-name">method_missing</span><span class="method-args">(sym, *args)</span>
541
- </a>
542
- </div>
543
-
544
- <div class="method-description">
545
- <p><a class="source-toggle" href="#"
546
- onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
547
- <div class="method-source-code" id="M000051-source">
548
- <pre>
549
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 304</span>
550
- 304: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
551
- 305: <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@lookup</span>
552
- 306: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> = <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>]
553
- 307: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@value</span>[<span class="ruby-identifier">pos</span>].<span class="ruby-identifier">value</span>
554
- 308: <span class="ruby-keyword kw">else</span>
555
- 309: <span class="ruby-identifier">sym</span> = <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">to_s</span>
556
- 310: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sym</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?=</span>
557
- 311: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> = <span class="ruby-ivar">@lookup</span>[<span class="ruby-identifier">sym</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">to_sym</span>]
558
- 312: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@value</span>[<span class="ruby-identifier">pos</span>].<span class="ruby-identifier">value</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
559
- 313: <span class="ruby-keyword kw">end</span>
560
- 314: <span class="ruby-keyword kw">end</span>
561
- 315: <span class="ruby-keyword kw">end</span>
562
- 316: <span class="ruby-keyword kw">super</span>
563
- 317: <span class="ruby-keyword kw">end</span>
564
- </pre>
565
- </div>
566
- </div>
567
- </div>
568
-
569
- <div id="method-M000054" class="method-detail">
570
- <a name="M000054"></a>
571
-
572
- <div class="method-heading">
573
- <a href="#M000054" class="method-signature">
574
- <span class="method-name">valid?</span><span class="method-args">()</span>
575
- </a>
576
- </div>
577
-
578
- <div class="method-description">
579
- <p><a class="source-toggle" href="#"
580
- onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
581
- <div class="method-source-code" id="M000054-source">
582
- <pre>
583
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 327</span>
584
- 327: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
585
- 328: <span class="ruby-ivar">@value</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">valid?</span> }
586
- 329: <span class="ruby-keyword kw">end</span>
587
- </pre>
588
- </div>
589
- </div>
590
- </div>
591
-
592
- <div id="method-M000052" class="method-detail">
593
- <a name="M000052"></a>
594
-
595
- <div class="method-heading">
596
- <a href="#M000052" class="method-signature">
597
- <span class="method-name">value</span><span class="method-args">()</span>
598
- </a>
599
- </div>
600
-
601
- <div class="method-description">
602
- <p><a class="source-toggle" href="#"
603
- onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
604
- <div class="method-source-code" id="M000052-source">
605
- <pre>
606
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 319</span>
607
- 319: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>
608
- 320: <span class="ruby-keyword kw">self</span>
609
- 321: <span class="ruby-keyword kw">end</span>
610
- </pre>
611
- </div>
612
- </div>
613
- </div>
614
-
615
- <div id="method-M000053" class="method-detail">
616
- <a name="M000053"></a>
617
-
618
- <div class="method-heading">
619
- <a href="#M000053" class="method-signature">
620
- <span class="method-name">value=</span><span class="method-args">(val)</span>
621
- </a>
622
- </div>
623
-
624
- <div class="method-description">
625
- <p><a class="source-toggle" href="#"
626
- onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
627
- <div class="method-source-code" id="M000053-source">
628
- <pre>
629
- <span class="ruby-comment cmt"># File lib/blocker.rb, line 323</span>
630
- 323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value=</span>(<span class="ruby-identifier">val</span>)
631
- 324: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Now what?&quot;</span>
632
- 325: <span class="ruby-keyword kw">end</span>
633
- </pre>
634
- </div>
635
- </div>
636
- </div>
637
-
638
-
639
- </div>
640
-
641
-
642
- </div>
643
-
644
-
645
- <div id="validator-badges">
646
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
647
- </div>
648
-
649
- </body>
650
- </html>