eymiha_util 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/gem_package.rb +1 -1
  2. data/html/classes/Envelope.html +47 -47
  3. data/html/classes/Envelope.src/M000016.html +5 -5
  4. data/html/classes/Envelope.src/M000017.html +5 -21
  5. data/html/classes/Envelope.src/M000018.html +21 -5
  6. data/html/classes/Envelope.src/M000019.html +4 -4
  7. data/html/classes/Envelope.src/M000020.html +5 -12
  8. data/html/classes/Envelope.src/M000021.html +26 -0
  9. data/html/classes/Envelope.src/{M000022.html → M000023.html} +0 -0
  10. data/html/classes/ForwardReference.html +22 -13
  11. data/html/classes/ForwardReference.src/M000024.html +7 -4
  12. data/html/classes/{ForwardReferencing.src → ForwardReference.src}/M000025.html +4 -6
  13. data/html/classes/ForwardReferencing.html +46 -43
  14. data/html/classes/ForwardReferencing.src/M000026.html +6 -6
  15. data/html/classes/ForwardReferencing.src/M000027.html +6 -6
  16. data/html/classes/ForwardReferencing.src/M000028.html +6 -14
  17. data/html/classes/ForwardReferencing.src/M000029.html +18 -4
  18. data/html/classes/ForwardReferencing.src/M000030.html +4 -11
  19. data/html/classes/ForwardReferencing.src/M000031.html +11 -4
  20. data/html/classes/ForwardReferencing.src/M000032.html +4 -4
  21. data/html/classes/ForwardReferencing.src/M000033.html +18 -0
  22. data/html/classes/Histogram.html +60 -60
  23. data/html/classes/Histogram.src/M000007.html +5 -7
  24. data/html/classes/Histogram.src/M000008.html +7 -23
  25. data/html/classes/Histogram.src/M000009.html +23 -4
  26. data/html/classes/Histogram.src/M000010.html +4 -6
  27. data/html/classes/Histogram.src/M000011.html +4 -4
  28. data/html/classes/Histogram.src/M000012.html +4 -4
  29. data/html/classes/Histogram.src/M000013.html +4 -4
  30. data/html/classes/Histogram.src/M000014.html +6 -10
  31. data/html/classes/Histogram.src/M000015.html +24 -0
  32. data/html/classes/MethodicHash.html +24 -2
  33. data/html/classes/MethodicHash.src/M000005.html +8 -8
  34. data/html/classes/MethodicHash.src/M000006.html +23 -0
  35. data/html/created.rid +1 -1
  36. data/html/files/lib/forward_referencing_rb.html +1 -1
  37. data/html/files/lib/methodic_hash_rb.html +1 -1
  38. data/html/fr_method_index.html +29 -28
  39. data/lib/forward_referencing.rb +21 -8
  40. data/lib/methodic_hash.rb +13 -0
  41. data/test/tc_methodic_hash.rb +47 -1
  42. metadata +8 -7
  43. data/html/classes/Envelope.src/M000015.html +0 -19
  44. data/html/classes/ForwardReference.src/M000023.html +0 -20
  45. data/html/classes/Histogram.src/M000006.html +0 -19
@@ -93,15 +93,15 @@ of the occurences of the keys.
93
93
  <h3 class="section-bar">Methods</h3>
94
94
 
95
95
  <div class="name-list">
96
- <a href="#M000013">&lt;</a>&nbsp;&nbsp;
97
- <a href="#M000012">&lt;=</a>&nbsp;&nbsp;
98
- <a href="#M000014">==</a>&nbsp;&nbsp;
99
- <a href="#M000011">&gt;</a>&nbsp;&nbsp;
100
- <a href="#M000010">&gt;=</a>&nbsp;&nbsp;
101
- <a href="#M000008">add</a>&nbsp;&nbsp;
102
- <a href="#M000007">count</a>&nbsp;&nbsp;
103
- <a href="#M000009">key_count</a>&nbsp;&nbsp;
104
- <a href="#M000006">new</a>&nbsp;&nbsp;
96
+ <a href="#M000014">&lt;</a>&nbsp;&nbsp;
97
+ <a href="#M000013">&lt;=</a>&nbsp;&nbsp;
98
+ <a href="#M000015">==</a>&nbsp;&nbsp;
99
+ <a href="#M000012">&gt;</a>&nbsp;&nbsp;
100
+ <a href="#M000011">&gt;=</a>&nbsp;&nbsp;
101
+ <a href="#M000009">add</a>&nbsp;&nbsp;
102
+ <a href="#M000008">count</a>&nbsp;&nbsp;
103
+ <a href="#M000010">key_count</a>&nbsp;&nbsp;
104
+ <a href="#M000007">new</a>&nbsp;&nbsp;
105
105
  </div>
106
106
  </div>
107
107
 
@@ -123,12 +123,12 @@ of the occurences of the keys.
123
123
  <div id="methods">
124
124
  <h3 class="section-bar">Public Class methods</h3>
125
125
 
126
- <div id="method-M000006" class="method-detail">
127
- <a name="M000006"></a>
126
+ <div id="method-M000007" class="method-detail">
127
+ <a name="M000007"></a>
128
128
 
129
129
  <div class="method-heading">
130
- <a href="Histogram.src/M000006.html" target="Code" class="method-signature"
131
- onclick="popupCode('Histogram.src/M000006.html');return false;">
130
+ <a href="Histogram.src/M000007.html" target="Code" class="method-signature"
131
+ onclick="popupCode('Histogram.src/M000007.html');return false;">
132
132
  <span class="method-name">new</span><span class="method-args">(key=nil,number=1)</span>
133
133
  </a>
134
134
  </div>
@@ -136,119 +136,119 @@ of the occurences of the keys.
136
136
  <div class="method-description">
137
137
  <p>
138
138
  Creates and returns an instance. If arguments are given, they are passed to
139
- the <a href="Histogram.html#M000008">add</a> method to initialize the <a
140
- href="Histogram.html#M000006">new</a> instance.
139
+ the <a href="Histogram.html#M000009">add</a> method to initialize the <a
140
+ href="Histogram.html#M000007">new</a> instance.
141
141
  </p>
142
142
  </div>
143
143
  </div>
144
144
 
145
145
  <h3 class="section-bar">Public Instance methods</h3>
146
146
 
147
- <div id="method-M000013" class="method-detail">
148
- <a name="M000013"></a>
147
+ <div id="method-M000014" class="method-detail">
148
+ <a name="M000014"></a>
149
149
 
150
150
  <div class="method-heading">
151
- <a href="Histogram.src/M000013.html" target="Code" class="method-signature"
152
- onclick="popupCode('Histogram.src/M000013.html');return false;">
151
+ <a href="Histogram.src/M000014.html" target="Code" class="method-signature"
152
+ onclick="popupCode('Histogram.src/M000014.html');return false;">
153
153
  <span class="method-name">&lt;</span><span class="method-args">(count)</span>
154
154
  </a>
155
155
  </div>
156
156
 
157
157
  <div class="method-description">
158
158
  <p>
159
- Returns a <a href="Histogram.html#M000006">new</a> <a
159
+ Returns a <a href="Histogram.html#M000007">new</a> <a
160
160
  href="Histogram.html">Histogram</a> containing the elements with occurences
161
- less than the given <a href="Histogram.html#M000007">count</a>.
161
+ less than the given <a href="Histogram.html#M000008">count</a>.
162
162
  </p>
163
163
  </div>
164
164
  </div>
165
165
 
166
- <div id="method-M000012" class="method-detail">
167
- <a name="M000012"></a>
166
+ <div id="method-M000013" class="method-detail">
167
+ <a name="M000013"></a>
168
168
 
169
169
  <div class="method-heading">
170
- <a href="Histogram.src/M000012.html" target="Code" class="method-signature"
171
- onclick="popupCode('Histogram.src/M000012.html');return false;">
170
+ <a href="Histogram.src/M000013.html" target="Code" class="method-signature"
171
+ onclick="popupCode('Histogram.src/M000013.html');return false;">
172
172
  <span class="method-name">&lt;=</span><span class="method-args">(count)</span>
173
173
  </a>
174
174
  </div>
175
175
 
176
176
  <div class="method-description">
177
177
  <p>
178
- Returns a <a href="Histogram.html#M000006">new</a> <a
178
+ Returns a <a href="Histogram.html#M000007">new</a> <a
179
179
  href="Histogram.html">Histogram</a> containing the elements with occurences
180
- less than or equal to the given <a href="Histogram.html#M000007">count</a>.
180
+ less than or equal to the given <a href="Histogram.html#M000008">count</a>.
181
181
  </p>
182
182
  </div>
183
183
  </div>
184
184
 
185
- <div id="method-M000014" class="method-detail">
186
- <a name="M000014"></a>
185
+ <div id="method-M000015" class="method-detail">
186
+ <a name="M000015"></a>
187
187
 
188
188
  <div class="method-heading">
189
- <a href="Histogram.src/M000014.html" target="Code" class="method-signature"
190
- onclick="popupCode('Histogram.src/M000014.html');return false;">
189
+ <a href="Histogram.src/M000015.html" target="Code" class="method-signature"
190
+ onclick="popupCode('Histogram.src/M000015.html');return false;">
191
191
  <span class="method-name">==</span><span class="method-args">(count)</span>
192
192
  </a>
193
193
  </div>
194
194
 
195
195
  <div class="method-description">
196
196
  <p>
197
- If <a href="Histogram.html#M000007">count</a> is a number, a <a
198
- href="Histogram.html#M000006">new</a> <a
197
+ If <a href="Histogram.html#M000008">count</a> is a number, a <a
198
+ href="Histogram.html#M000007">new</a> <a
199
199
  href="Histogram.html">Histogram</a> containing the elements with occurences
200
200
  equal to the given countis returned. If the <a
201
- href="Histogram.html#M000007">count</a> is a histogram, true is returned if
201
+ href="Histogram.html#M000008">count</a> is a histogram, true is returned if
202
202
  the instance contains the same keys and values; false otherwise.
203
203
  </p>
204
204
  </div>
205
205
  </div>
206
206
 
207
- <div id="method-M000011" class="method-detail">
208
- <a name="M000011"></a>
207
+ <div id="method-M000012" class="method-detail">
208
+ <a name="M000012"></a>
209
209
 
210
210
  <div class="method-heading">
211
- <a href="Histogram.src/M000011.html" target="Code" class="method-signature"
212
- onclick="popupCode('Histogram.src/M000011.html');return false;">
211
+ <a href="Histogram.src/M000012.html" target="Code" class="method-signature"
212
+ onclick="popupCode('Histogram.src/M000012.html');return false;">
213
213
  <span class="method-name">&gt;</span><span class="method-args">(count)</span>
214
214
  </a>
215
215
  </div>
216
216
 
217
217
  <div class="method-description">
218
218
  <p>
219
- Returns a <a href="Histogram.html#M000006">new</a> <a
219
+ Returns a <a href="Histogram.html#M000007">new</a> <a
220
220
  href="Histogram.html">Histogram</a> containing the elements with occurences
221
- greater than the given <a href="Histogram.html#M000007">count</a>.
221
+ greater than the given <a href="Histogram.html#M000008">count</a>.
222
222
  </p>
223
223
  </div>
224
224
  </div>
225
225
 
226
- <div id="method-M000010" class="method-detail">
227
- <a name="M000010"></a>
226
+ <div id="method-M000011" class="method-detail">
227
+ <a name="M000011"></a>
228
228
 
229
229
  <div class="method-heading">
230
- <a href="Histogram.src/M000010.html" target="Code" class="method-signature"
231
- onclick="popupCode('Histogram.src/M000010.html');return false;">
230
+ <a href="Histogram.src/M000011.html" target="Code" class="method-signature"
231
+ onclick="popupCode('Histogram.src/M000011.html');return false;">
232
232
  <span class="method-name">&gt;=</span><span class="method-args">(count)</span>
233
233
  </a>
234
234
  </div>
235
235
 
236
236
  <div class="method-description">
237
237
  <p>
238
- Returns a <a href="Histogram.html#M000006">new</a> <a
238
+ Returns a <a href="Histogram.html#M000007">new</a> <a
239
239
  href="Histogram.html">Histogram</a> containing the elements with occurences
240
240
  greater than or equal to the given <a
241
- href="Histogram.html#M000007">count</a>.
241
+ href="Histogram.html#M000008">count</a>.
242
242
  </p>
243
243
  </div>
244
244
  </div>
245
245
 
246
- <div id="method-M000008" class="method-detail">
247
- <a name="M000008"></a>
246
+ <div id="method-M000009" class="method-detail">
247
+ <a name="M000009"></a>
248
248
 
249
249
  <div class="method-heading">
250
- <a href="Histogram.src/M000008.html" target="Code" class="method-signature"
251
- onclick="popupCode('Histogram.src/M000008.html');return false;">
250
+ <a href="Histogram.src/M000009.html" target="Code" class="method-signature"
251
+ onclick="popupCode('Histogram.src/M000009.html');return false;">
252
252
  <span class="method-name">add</span><span class="method-args">(key,count=1)</span>
253
253
  </a>
254
254
  </div>
@@ -256,14 +256,14 @@ href="Histogram.html#M000007">count</a>.
256
256
  <div class="method-description">
257
257
  <p>
258
258
  Adds the key to the instance if it doesn&#8216;t already exist, and adds
259
- the specified <a href="Histogram.html#M000007">count</a> to it value. If
259
+ the specified <a href="Histogram.html#M000008">count</a> to it value. If
260
260
  the key is
261
261
  </p>
262
262
  <ul>
263
263
  <li>an Array, each member of the array is added. if the member itself is an
264
264
  Array, then if that array has one member, the member is added as a key; if
265
265
  two members, the member is added as a key and a <a
266
- href="Histogram.html#M000007">count</a>; otherwise, a <a
266
+ href="Histogram.html#M000008">count</a>; otherwise, a <a
267
267
  href="HistogramException.html">HistogramException</a> is thrown.
268
268
 
269
269
  </li>
@@ -275,12 +275,12 @@ instance.
275
275
  </div>
276
276
  </div>
277
277
 
278
- <div id="method-M000007" class="method-detail">
279
- <a name="M000007"></a>
278
+ <div id="method-M000008" class="method-detail">
279
+ <a name="M000008"></a>
280
280
 
281
281
  <div class="method-heading">
282
- <a href="Histogram.src/M000007.html" target="Code" class="method-signature"
283
- onclick="popupCode('Histogram.src/M000007.html');return false;">
282
+ <a href="Histogram.src/M000008.html" target="Code" class="method-signature"
283
+ onclick="popupCode('Histogram.src/M000008.html');return false;">
284
284
  <span class="method-name">count</span><span class="method-args">(check_keys = keys)</span>
285
285
  </a>
286
286
  </div>
@@ -293,12 +293,12 @@ given, the sum of the number of occurences of those keys is returned.
293
293
  </div>
294
294
  </div>
295
295
 
296
- <div id="method-M000009" class="method-detail">
297
- <a name="M000009"></a>
296
+ <div id="method-M000010" class="method-detail">
297
+ <a name="M000010"></a>
298
298
 
299
299
  <div class="method-heading">
300
- <a href="Histogram.src/M000009.html" target="Code" class="method-signature"
301
- onclick="popupCode('Histogram.src/M000009.html');return false;">
300
+ <a href="Histogram.src/M000010.html" target="Code" class="method-signature"
301
+ onclick="popupCode('Histogram.src/M000010.html');return false;">
302
302
  <span class="method-name">key_count</span><span class="method-args">()</span>
303
303
  </a>
304
304
  </div>
@@ -5,17 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>count (Histogram)</title>
8
+ <title>new (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 24</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>(<span class="ruby-identifier">check_keys</span> = <span class="ruby-identifier">keys</span>)
15
- <span class="ruby-identifier">check_keys</span> = [<span class="ruby-identifier">check_keys</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">check_keys</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
16
- <span class="ruby-identifier">count</span> = <span class="ruby-value">0</span>
17
- <span class="ruby-identifier">check_keys</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">key</span> }
18
- <span class="ruby-identifier">count</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 17</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">key</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">number</span>=<span class="ruby-value">1</span>)
15
+ <span class="ruby-keyword kw">super</span>()
16
+ <span class="ruby-identifier">add</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">number</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
19
17
  <span class="ruby-keyword kw">end</span></pre>
20
18
  </body>
21
19
  </html>
@@ -5,33 +5,17 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>add (Histogram)</title>
8
+ <title>count (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 35</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">count</span>=<span class="ruby-value">1</span>)
15
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
16
- <span class="ruby-identifier">key</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
17
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
18
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
19
- <span class="ruby-identifier">add</span>(<span class="ruby-identifier">member</span>[<span class="ruby-value">0</span>])
20
- <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">member</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">member</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</span>)
21
- <span class="ruby-identifier">add</span>(<span class="ruby-identifier">member</span>[<span class="ruby-value">0</span>],<span class="ruby-identifier">member</span>[<span class="ruby-value">1</span>])
22
- <span class="ruby-keyword kw">else</span>
23
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">HistogramException</span>, <span class="ruby-value str">&quot;add cannot interpret Array to add&quot;</span>
24
- <span class="ruby-keyword kw">end</span>
25
- <span class="ruby-keyword kw">else</span>
26
- <span class="ruby-identifier">add</span> <span class="ruby-identifier">member</span>
27
- <span class="ruby-keyword kw">end</span>
28
- }
29
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Histogram</span>
30
- <span class="ruby-identifier">key</span>.<span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) }
31
- <span class="ruby-keyword kw">else</span>
32
- <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] = ((<span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>]) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span><span class="ruby-operator">+</span><span class="ruby-identifier">count</span>
33
- <span class="ruby-keyword kw">end</span>
34
- <span class="ruby-keyword kw">self</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 24</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>(<span class="ruby-identifier">check_keys</span> = <span class="ruby-identifier">keys</span>)
15
+ <span class="ruby-identifier">check_keys</span> = [<span class="ruby-identifier">check_keys</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">check_keys</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
16
+ <span class="ruby-identifier">count</span> = <span class="ruby-value">0</span>
17
+ <span class="ruby-identifier">check_keys</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">key</span> }
18
+ <span class="ruby-identifier">count</span>
35
19
  <span class="ruby-keyword kw">end</span></pre>
36
20
  </body>
37
21
  </html>
@@ -5,14 +5,33 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>key_count (Histogram)</title>
8
+ <title>add (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 59</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_count</span>
15
- <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">size</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 35</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">count</span>=<span class="ruby-value">1</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
16
+ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
19
+ <span class="ruby-identifier">add</span>(<span class="ruby-identifier">member</span>[<span class="ruby-value">0</span>])
20
+ <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">member</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">member</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</span>)
21
+ <span class="ruby-identifier">add</span>(<span class="ruby-identifier">member</span>[<span class="ruby-value">0</span>],<span class="ruby-identifier">member</span>[<span class="ruby-value">1</span>])
22
+ <span class="ruby-keyword kw">else</span>
23
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">HistogramException</span>, <span class="ruby-value str">&quot;add cannot interpret Array to add&quot;</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">else</span>
26
+ <span class="ruby-identifier">add</span> <span class="ruby-identifier">member</span>
27
+ <span class="ruby-keyword kw">end</span>
28
+ }
29
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Histogram</span>
30
+ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) }
31
+ <span class="ruby-keyword kw">else</span>
32
+ <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] = ((<span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>]) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span><span class="ruby-operator">+</span><span class="ruby-identifier">count</span>
33
+ <span class="ruby-keyword kw">end</span>
34
+ <span class="ruby-keyword kw">self</span>
16
35
  <span class="ruby-keyword kw">end</span></pre>
17
36
  </body>
18
37
  </html>
@@ -5,16 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>&gt;= (Histogram)</title>
8
+ <title>key_count (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 65</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;=</span>(<span class="ruby-identifier">count</span>)
15
- <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
16
- <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">count</span> }
17
- <span class="ruby-identifier">result</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 59</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_count</span>
15
+ <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">size</span>
18
16
  <span class="ruby-keyword kw">end</span></pre>
19
17
  </body>
20
18
  </html>
@@ -5,15 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>&gt; (Histogram)</title>
8
+ <title>&gt;= (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 73</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;</span>(<span class="ruby-identifier">count</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 65</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;=</span>(<span class="ruby-identifier">count</span>)
15
15
  <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
16
- <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">count</span> }
16
+ <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">count</span> }
17
17
  <span class="ruby-identifier">result</span>
18
18
  <span class="ruby-keyword kw">end</span></pre>
19
19
  </body>
@@ -5,15 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>&lt;= (Histogram)</title>
8
+ <title>&gt; (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 81</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=</span>(<span class="ruby-identifier">count</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 73</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;</span>(<span class="ruby-identifier">count</span>)
15
15
  <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
16
- <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">count</span> }
16
+ <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">count</span> }
17
17
  <span class="ruby-identifier">result</span>
18
18
  <span class="ruby-keyword kw">end</span></pre>
19
19
  </body>
@@ -5,15 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>&lt; (Histogram)</title>
8
+ <title>&lt;= (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 89</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;</span>(<span class="ruby-identifier">count</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 81</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=</span>(<span class="ruby-identifier">count</span>)
15
15
  <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
16
- <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">count</span> }
16
+ <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">count</span> }
17
17
  <span class="ruby-identifier">result</span>
18
18
  <span class="ruby-keyword kw">end</span></pre>
19
19
  </body>
@@ -5,20 +5,16 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>== (Histogram)</title>
8
+ <title>&lt; (Histogram)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 99</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">count</span>)
15
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">count</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
16
- <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
17
- <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">count</span> }
18
- <span class="ruby-identifier">result</span>
19
- <span class="ruby-keyword kw">else</span>
20
- <span class="ruby-keyword kw">super</span>
21
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 89</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;</span>(<span class="ruby-identifier">count</span>)
15
+ <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
16
+ <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">count</span> }
17
+ <span class="ruby-identifier">result</span>
22
18
  <span class="ruby-keyword kw">end</span></pre>
23
19
  </body>
24
20
  </html>
@@ -0,0 +1,24 @@
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>
7
+ <head>
8
+ <title>== (Histogram)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/histogram.rb, line 99</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">count</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">count</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
16
+ <span class="ruby-identifier">result</span> = <span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</span>
17
+ <span class="ruby-identifier">each_pair</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">count</span> }
18
+ <span class="ruby-identifier">result</span>
19
+ <span class="ruby-keyword kw">else</span>
20
+ <span class="ruby-keyword kw">super</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -81,7 +81,7 @@
81
81
  <div id="description">
82
82
  <p>
83
83
  The <a href="MethodicHash.html">MethodicHash</a> is some <a
84
- href="MethodicHash.html#M000005">method_missing</a> magic that uses method
84
+ href="MethodicHash.html#M000006">method_missing</a> magic that uses method
85
85
  names as hash keys, so hash assignment and lookup appear to be attribute
86
86
  writing and reading. For instance, if
87
87
  </p>
@@ -126,7 +126,8 @@ bizarre manner. Note also that methods of the Hash cannot be used as
126
126
 
127
127
  <div class="name-list">
128
128
  <a href="#M000004">[]</a>&nbsp;&nbsp;
129
- <a href="#M000005">method_missing</a>&nbsp;&nbsp;
129
+ <a href="#M000005">delete</a>&nbsp;&nbsp;
130
+ <a href="#M000006">method_missing</a>&nbsp;&nbsp;
130
131
  </div>
131
132
  </div>
132
133
 
@@ -173,6 +174,27 @@ with a nil.
173
174
  <div class="method-heading">
174
175
  <a href="MethodicHash.src/M000005.html" target="Code" class="method-signature"
175
176
  onclick="popupCode('MethodicHash.src/M000005.html');return false;">
177
+ <span class="method-name">delete</span><span class="method-args">(key,&amp;block)</span>
178
+ </a>
179
+ </div>
180
+
181
+ <div class="method-description">
182
+ <p>
183
+ Deletes and returns the key-value pairs from hash whose keys are equal to
184
+ key.to_s or key.to_sym. If both key.to_s and key.to_sym are in the hash,
185
+ then both values are returned in an Array, respectively. If neither key is
186
+ found, the <a href="MethodicHash.html#M000005">delete</a> is deferred to
187
+ the Hash.
188
+ </p>
189
+ </div>
190
+ </div>
191
+
192
+ <div id="method-M000006" class="method-detail">
193
+ <a name="M000006"></a>
194
+
195
+ <div class="method-heading">
196
+ <a href="MethodicHash.src/M000006.html" target="Code" class="method-signature"
197
+ onclick="popupCode('MethodicHash.src/M000006.html');return false;">
176
198
  <span class="method-name">method_missing</span><span class="method-args">(method,*args)</span>
177
199
  </a>
178
200
  </div>