facets 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +113 -13
- data/MANIFEST +23 -19
- data/RELEASE +22 -22
- data/VERSION +1 -1
- data/doc/{archive → changelogs}/CHANGELOG-0.10.30 +0 -0
- data/doc/{archive → changelogs}/CHANGELOG-1.8.54 +0 -0
- data/doc/{archive → changelogs}/CHANGELOG-2.4.5 +0 -0
- data/doc/log/basic_stats/index.html +4 -4
- data/doc/rdoc/core/classes/Array.html +148 -148
- data/doc/rdoc/core/classes/Binding.html +45 -45
- data/doc/rdoc/core/classes/Class.html +38 -38
- data/doc/rdoc/core/classes/Comparable.html +26 -26
- data/doc/rdoc/core/classes/Enumerable.html +224 -139
- data/doc/rdoc/core/classes/Enumerable/Enumerator.html +126 -13
- data/doc/rdoc/core/classes/Enumerator.html +123 -13
- data/doc/rdoc/core/classes/Exception.html +8 -8
- data/doc/rdoc/core/classes/File.html +58 -58
- data/doc/rdoc/core/classes/FileTest.html +4 -4
- data/doc/rdoc/core/classes/Float.html +8 -8
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +289 -266
- data/doc/rdoc/core/classes/Indexable.html +110 -110
- data/doc/rdoc/core/classes/Integer.html +2 -2
- data/doc/rdoc/core/classes/Kernel.html +329 -329
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +15 -15
- data/doc/rdoc/core/classes/Module.html +161 -161
- data/doc/rdoc/core/classes/NilClass.html +23 -23
- data/doc/rdoc/core/classes/Numeric.html +27 -27
- data/doc/rdoc/core/classes/Object.html +8 -8
- data/doc/rdoc/core/classes/ObjectSpace.html +5 -5
- data/doc/rdoc/core/classes/Proc.html +22 -22
- data/doc/rdoc/core/classes/Regexp.html +1 -1
- data/doc/rdoc/core/classes/Stackable.html +31 -31
- data/doc/rdoc/core/classes/String.html +270 -270
- data/doc/rdoc/core/classes/Symbol.html +1 -1
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +12 -12
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/dearray_values_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +2 -1
- data/doc/rdoc/core/fr_file_index.html +1 -0
- data/doc/rdoc/core/fr_method_index.html +401 -385
- data/doc/{archive → release-notes}/RELEASE-2.0.5 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.1.0 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.1.1 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.1.2 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.1.3 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.2.0 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.2.1 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.3.0 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.0 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.1 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.2 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.3 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.4 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.4.5 +0 -0
- data/doc/{archive → release-notes}/RELEASE-2.5.0 +0 -0
- data/lib/core/facets/hash/dearray_values.rb +46 -0
- data/lib/core/facets/to_hash.rb +109 -74
- data/task/setup.rake +17 -9
- data/test/core/hash/test_dearray_values.rb +19 -0
- data/test/core/test_to_hash.rb +116 -24
- metadata +26 -21
@@ -98,37 +98,42 @@
|
|
98
98
|
|
99
99
|
|
100
100
|
<div class="sectiontitle">Methods</div>
|
101
|
-
<span style="padding-right: 5px;"><a href="#
|
102
|
-
<span style="padding-right: 5px;"><a href="#
|
103
|
-
<span style="padding-right: 5px;"><a href="#
|
104
|
-
<span style="padding-right: 5px;"><a href="#
|
105
|
-
<span style="padding-right: 5px;"><a href="#
|
106
|
-
<span style="padding-right: 5px;"><a href="#
|
107
|
-
<span style="padding-right: 5px;"><a href="#
|
108
|
-
<span style="padding-right: 5px;"><a href="#
|
109
|
-
<span style="padding-right: 5px;"><a href="#
|
110
|
-
<span style="padding-right: 5px;"><a href="#
|
111
|
-
<span style="padding-right: 5px;"><a href="#
|
112
|
-
<span style="padding-right: 5px;"><a href="#
|
113
|
-
<span style="padding-right: 5px;"><a href="#
|
114
|
-
<span style="padding-right: 5px;"><a href="#
|
115
|
-
<span style="padding-right: 5px;"><a href="#
|
116
|
-
<span style="padding-right: 5px;"><a href="#
|
117
|
-
<span style="padding-right: 5px;"><a href="#
|
118
|
-
<span style="padding-right: 5px;"><a href="#
|
119
|
-
<span style="padding-right: 5px;"><a href="#
|
120
|
-
<span style="padding-right: 5px;"><a href="#
|
121
|
-
<span style="padding-right: 5px;"><a href="#
|
122
|
-
<span style="padding-right: 5px;"><a href="#
|
123
|
-
<span style="padding-right: 5px;"><a href="#
|
124
|
-
<span style="padding-right: 5px;"><a href="#
|
125
|
-
<span style="padding-right: 5px;"><a href="#
|
126
|
-
<span style="padding-right: 5px;"><a href="#
|
127
|
-
<span style="padding-right: 5px;"><a href="#
|
128
|
-
<span style="padding-right: 5px;"><a href="#
|
129
|
-
<span style="padding-right: 5px;"><a href="#
|
130
|
-
<span style="padding-right: 5px;"><a href="#
|
131
|
-
<span style="padding-right: 5px;"><a href="#
|
101
|
+
<span style="padding-right: 5px;"><a href="#M000454">accumulate</a></span>
|
102
|
+
<span style="padding-right: 5px;"><a href="#M000441">cluster_by</a></span>
|
103
|
+
<span style="padding-right: 5px;"><a href="#M000464">collect_with_index</a></span>
|
104
|
+
<span style="padding-right: 5px;"><a href="#M000445">commonality</a></span>
|
105
|
+
<span style="padding-right: 5px;"><a href="#M000468">compact_collect</a></span>
|
106
|
+
<span style="padding-right: 5px;"><a href="#M000467">compact_map</a></span>
|
107
|
+
<span style="padding-right: 5px;"><a href="#M000465">count</a></span>
|
108
|
+
<span style="padding-right: 5px;"><a href="#M000448">divide</a></span>
|
109
|
+
<span style="padding-right: 5px;"><a href="#M000451">duplicates</a></span>
|
110
|
+
<span style="padding-right: 5px;"><a href="#M000466">each_by</a></span>
|
111
|
+
<span style="padding-right: 5px;"><a href="#M000458">entropy</a></span>
|
112
|
+
<span style="padding-right: 5px;"><a href="#M000447">frequency</a></span>
|
113
|
+
<span style="padding-right: 5px;"><a href="#M000456">graph</a></span>
|
114
|
+
<span style="padding-right: 5px;"><a href="#M000442">group_by</a></span>
|
115
|
+
<span style="padding-right: 5px;"><a href="#M000459">ideal_entropy</a></span>
|
116
|
+
<span style="padding-right: 5px;"><a href="#M000449">inject!</a></span>
|
117
|
+
<span style="padding-right: 5px;"><a href="#M000461">map_send</a></span>
|
118
|
+
<span style="padding-right: 5px;"><a href="#M000463">map_with_index</a></span>
|
119
|
+
<span style="padding-right: 5px;"><a href="#M000455">mash</a></span>
|
120
|
+
<span style="padding-right: 5px;"><a href="#M000444">mode</a></span>
|
121
|
+
<span style="padding-right: 5px;"><a href="#M000457">modulate</a></span>
|
122
|
+
<span style="padding-right: 5px;"><a href="#M000452">none?</a></span>
|
123
|
+
<span style="padding-right: 5px;"><a href="#M000450">nonuniq</a></span>
|
124
|
+
<span style="padding-right: 5px;"><a href="#M000446">occur</a></span>
|
125
|
+
<span style="padding-right: 5px;"><a href="#M000440">one?</a></span>
|
126
|
+
<span style="padding-right: 5px;"><a href="#M000462">probability</a></span>
|
127
|
+
<span style="padding-right: 5px;"><a href="#M000460">split</a></span>
|
128
|
+
<span style="padding-right: 5px;"><a href="#M000443">sum</a></span>
|
129
|
+
<span style="padding-right: 5px;"><a href="#M000439">take</a></span>
|
130
|
+
<span style="padding-right: 5px;"><a href="#M000433">to_h</a></span>
|
131
|
+
<span style="padding-right: 5px;"><a href="#M000437">to_h_assoc</a></span>
|
132
|
+
<span style="padding-right: 5px;"><a href="#M000434">to_h_auto</a></span>
|
133
|
+
<span style="padding-right: 5px;"><a href="#M000436">to_h_flat</a></span>
|
134
|
+
<span style="padding-right: 5px;"><a href="#M000438">to_h_multi</a></span>
|
135
|
+
<span style="padding-right: 5px;"><a href="#M000435">to_h_splat</a></span>
|
136
|
+
<span style="padding-right: 5px;"><a href="#M000453">uniq_by</a></span>
|
132
137
|
|
133
138
|
|
134
139
|
|
@@ -141,7 +146,7 @@
|
|
141
146
|
<div class="sectiontitle">Public Instance methods</div>
|
142
147
|
<div class="method">
|
143
148
|
<div class="title">
|
144
|
-
<a name="
|
149
|
+
<a name="M000454"></a><b>accumulate</b>()
|
145
150
|
</div>
|
146
151
|
<div class="description">
|
147
152
|
<p>
|
@@ -161,8 +166,8 @@ CREDIT: George Moshchovitis
|
|
161
166
|
</p>
|
162
167
|
</div>
|
163
168
|
<div class="sourcecode">
|
164
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
165
|
-
<div id="
|
169
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000454_source')" id="l_M000454_source">+</a> ]</p>
|
170
|
+
<div id="M000454_source" class="dyn-source">
|
166
171
|
<pre>
|
167
172
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/accumulate.rb, line 16</span>
|
168
173
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accumulate</span>
|
@@ -176,11 +181,11 @@ CREDIT: George Moshchovitis
|
|
176
181
|
</div>
|
177
182
|
<div class="method">
|
178
183
|
<div class="title">
|
179
|
-
<a name="
|
184
|
+
<a name="M000441"></a><b>cluster_by</b>(&b)
|
180
185
|
</div>
|
181
186
|
<div class="description">
|
182
187
|
<p>
|
183
|
-
Similar to <a href="Enumerable.html#
|
188
|
+
Similar to <a href="Enumerable.html#M000442">group_by</a> but returns an
|
184
189
|
array of the groups. Returned elements are sorted by block.
|
185
190
|
</p>
|
186
191
|
<pre>
|
@@ -197,8 +202,8 @@ CREDIT: Erik Veenstra
|
|
197
202
|
</p>
|
198
203
|
</div>
|
199
204
|
<div class="sourcecode">
|
200
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
201
|
-
<div id="
|
205
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000441_source')" id="l_M000441_source">+</a> ]</p>
|
206
|
+
<div id="M000441_source" class="dyn-source">
|
202
207
|
<pre>
|
203
208
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/cluster_by.rb, line 16</span>
|
204
209
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cluster_by</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">b</span>)
|
@@ -210,17 +215,17 @@ CREDIT: Erik Veenstra
|
|
210
215
|
</div>
|
211
216
|
<div class="method">
|
212
217
|
<div class="title">
|
213
|
-
<a name="
|
218
|
+
<a name="M000464"></a><b>collect_with_index</b>()
|
214
219
|
</div>
|
215
220
|
<div class="description">
|
216
221
|
<p>
|
217
|
-
Alias for <a href="Enumerable.html#
|
222
|
+
Alias for <a href="Enumerable.html#M000463">map_with_index</a>
|
218
223
|
</p>
|
219
224
|
</div>
|
220
225
|
</div>
|
221
226
|
<div class="method">
|
222
227
|
<div class="title">
|
223
|
-
<a name="
|
228
|
+
<a name="M000445"></a><b>commonality</b>( &block )
|
224
229
|
</div>
|
225
230
|
<div class="description">
|
226
231
|
<p>
|
@@ -242,8 +247,8 @@ CREDIT: Florian Gross
|
|
242
247
|
</p>
|
243
248
|
</div>
|
244
249
|
<div class="sourcecode">
|
245
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
246
|
-
<div id="
|
250
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000445_source')" id="l_M000445_source">+</a> ]</p>
|
251
|
+
<div id="M000445_source" class="dyn-source">
|
247
252
|
<pre>
|
248
253
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/commonality.rb, line 17</span>
|
249
254
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commonality</span>( <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> )
|
@@ -266,17 +271,17 @@ CREDIT: Florian Gross
|
|
266
271
|
</div>
|
267
272
|
<div class="method">
|
268
273
|
<div class="title">
|
269
|
-
<a name="
|
274
|
+
<a name="M000468"></a><b>compact_collect</b>(trash=nil, &block)
|
270
275
|
</div>
|
271
276
|
<div class="description">
|
272
277
|
<p>
|
273
|
-
Alias for <a href="Enumerable.html#
|
278
|
+
Alias for <a href="Enumerable.html#M000467">compact_map</a>
|
274
279
|
</p>
|
275
280
|
</div>
|
276
281
|
</div>
|
277
282
|
<div class="method">
|
278
283
|
<div class="title">
|
279
|
-
<a name="
|
284
|
+
<a name="M000467"></a><b>compact_map</b>(trash=nil) {|*a| ...}
|
280
285
|
</div>
|
281
286
|
<div class="description">
|
282
287
|
<p>
|
@@ -303,11 +308,11 @@ CREDIT: Trans
|
|
303
308
|
</div>
|
304
309
|
<div class="aka">
|
305
310
|
This method is also aliased as
|
306
|
-
<a href="Enumerable.html#
|
311
|
+
<a href="Enumerable.html#M000468">compact_collect</a>
|
307
312
|
</div>
|
308
313
|
<div class="sourcecode">
|
309
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
310
|
-
<div id="
|
314
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000467_source')" id="l_M000467_source">+</a> ]</p>
|
315
|
+
<div id="M000467_source" class="dyn-source">
|
311
316
|
<pre>
|
312
317
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/compact_map.rb, line 18</span>
|
313
318
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compact_map</span>(<span class="ruby-identifier">trash</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -330,7 +335,7 @@ CREDIT: Trans
|
|
330
335
|
</div>
|
331
336
|
<div class="method">
|
332
337
|
<div class="title">
|
333
|
-
<a name="
|
338
|
+
<a name="M000465"></a><b>count</b>(*c)
|
334
339
|
</div>
|
335
340
|
<div class="description">
|
336
341
|
<p>
|
@@ -353,8 +358,8 @@ CREDIT: Trans
|
|
353
358
|
</p>
|
354
359
|
</div>
|
355
360
|
<div class="sourcecode">
|
356
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
357
|
-
<div id="
|
361
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000465_source')" id="l_M000465_source">+</a> ]</p>
|
362
|
+
<div id="M000465_source" class="dyn-source">
|
358
363
|
<pre>
|
359
364
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/count.rb, line 19</span>
|
360
365
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">c</span>)
|
@@ -366,7 +371,7 @@ CREDIT: Trans
|
|
366
371
|
</div>
|
367
372
|
<div class="method">
|
368
373
|
<div class="title">
|
369
|
-
<a name="
|
374
|
+
<a name="M000448"></a><b>divide</b>(pattern)
|
370
375
|
</div>
|
371
376
|
<div class="description">
|
372
377
|
<p>
|
@@ -381,8 +386,8 @@ CREDIT: Trans
|
|
381
386
|
</p>
|
382
387
|
</div>
|
383
388
|
<div class="sourcecode">
|
384
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
385
|
-
<div id="
|
389
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000448_source')" id="l_M000448_source">+</a> ]</p>
|
390
|
+
<div id="M000448_source" class="dyn-source">
|
386
391
|
<pre>
|
387
392
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/divide.rb, line 10</span>
|
388
393
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divide</span>(<span class="ruby-identifier">pattern</span>)
|
@@ -399,17 +404,17 @@ CREDIT: Trans
|
|
399
404
|
</div>
|
400
405
|
<div class="method">
|
401
406
|
<div class="title">
|
402
|
-
<a name="
|
407
|
+
<a name="M000451"></a><b>duplicates</b>()
|
403
408
|
</div>
|
404
409
|
<div class="description">
|
405
410
|
<p>
|
406
|
-
Alias for <a href="Enumerable.html#
|
411
|
+
Alias for <a href="Enumerable.html#M000450">nonuniq</a>
|
407
412
|
</p>
|
408
413
|
</div>
|
409
414
|
</div>
|
410
415
|
<div class="method">
|
411
416
|
<div class="title">
|
412
|
-
<a name="
|
417
|
+
<a name="M000466"></a><b>each_by</b>(steps=nil, &block)
|
413
418
|
</div>
|
414
419
|
<div class="description">
|
415
420
|
<p>
|
@@ -434,8 +439,8 @@ CREDIT: Trans
|
|
434
439
|
</p>
|
435
440
|
</div>
|
436
441
|
<div class="sourcecode">
|
437
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
438
|
-
<div id="
|
442
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000466_source')" id="l_M000466_source">+</a> ]</p>
|
443
|
+
<div id="M000466_source" class="dyn-source">
|
439
444
|
<pre>
|
440
445
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/each_by.rb, line 22</span>
|
441
446
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_by</span>(<span class="ruby-identifier">steps</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -453,13 +458,13 @@ CREDIT: Trans
|
|
453
458
|
</div>
|
454
459
|
<div class="method">
|
455
460
|
<div class="title">
|
456
|
-
<a name="
|
461
|
+
<a name="M000458"></a><b>entropy</b>()
|
457
462
|
</div>
|
458
463
|
<div class="description">
|
459
464
|
<p>
|
460
|
-
Shannon‘s <a href="Enumerable.html#
|
465
|
+
Shannon‘s <a href="Enumerable.html#M000458">entropy</a> for an array
|
461
466
|
- returns the average bits per symbol required to encode the array. Lower
|
462
|
-
values mean less "<a href="Enumerable.html#
|
467
|
+
values mean less "<a href="Enumerable.html#M000458">entropy</a>"
|
463
468
|
- i.e. less unique information in the array.
|
464
469
|
</p>
|
465
470
|
<pre>
|
@@ -470,8 +475,8 @@ CREDIT: Derek
|
|
470
475
|
</p>
|
471
476
|
</div>
|
472
477
|
<div class="sourcecode">
|
473
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
474
|
-
<div id="
|
478
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000458_source')" id="l_M000458_source">+</a> ]</p>
|
479
|
+
<div id="M000458_source" class="dyn-source">
|
475
480
|
<pre>
|
476
481
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/entropy.rb, line 14</span>
|
477
482
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entropy</span>
|
@@ -489,20 +494,20 @@ CREDIT: Derek
|
|
489
494
|
</div>
|
490
495
|
<div class="method">
|
491
496
|
<div class="title">
|
492
|
-
<a name="
|
497
|
+
<a name="M000447"></a><b>frequency</b>()
|
493
498
|
</div>
|
494
499
|
<div class="description">
|
495
500
|
<p>
|
496
501
|
Generates a hash mapping each unique symbol in the array to the absolute <a
|
497
|
-
href="Enumerable.html#
|
502
|
+
href="Enumerable.html#M000447">frequency</a> it appears.
|
498
503
|
</p>
|
499
504
|
<p>
|
500
505
|
CREDIT: Brian Schröder
|
501
506
|
</p>
|
502
507
|
</div>
|
503
508
|
<div class="sourcecode">
|
504
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
505
|
-
<div id="
|
509
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000447_source')" id="l_M000447_source">+</a> ]</p>
|
510
|
+
<div id="M000447_source" class="dyn-source">
|
506
511
|
<pre>
|
507
512
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/frequency.rb, line 8</span>
|
508
513
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">frequency</span>
|
@@ -519,21 +524,21 @@ CREDIT: Brian Schröder
|
|
519
524
|
</div>
|
520
525
|
<div class="method">
|
521
526
|
<div class="title">
|
522
|
-
<a name="
|
527
|
+
<a name="M000456"></a><b>graph</b>(&yld)
|
523
528
|
</div>
|
524
529
|
<div class="description">
|
525
530
|
<p>
|
526
|
-
Alias for <a href="Enumerable.html#
|
531
|
+
Alias for <a href="Enumerable.html#M000455">mash</a>
|
527
532
|
</p>
|
528
533
|
</div>
|
529
534
|
</div>
|
530
535
|
<div class="method">
|
531
536
|
<div class="title">
|
532
|
-
<a name="
|
537
|
+
<a name="M000442"></a><b>group_by</b>( {|| ...}
|
533
538
|
</div>
|
534
539
|
<div class="description">
|
535
540
|
<p>
|
536
|
-
<a href="Enumerable.html#
|
541
|
+
<a href="Enumerable.html#M000442">group_by</a> is used to group items in a
|
537
542
|
collection by something they have in common. The common factor is the key
|
538
543
|
in the resulting hash, the array of like elements is the value.
|
539
544
|
</p>
|
@@ -549,8 +554,8 @@ CREDIT: Erik Veenstra
|
|
549
554
|
</p>
|
550
555
|
</div>
|
551
556
|
<div class="sourcecode">
|
552
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
553
|
-
<div id="
|
557
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000442_source')" id="l_M000442_source">+</a> ]</p>
|
558
|
+
<div id="M000442_source" class="dyn-source">
|
554
559
|
<pre>
|
555
560
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/group_by.rb, line 17</span>
|
556
561
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group_by</span> <span class="ruby-comment cmt">#:yield:</span>
|
@@ -565,12 +570,12 @@ CREDIT: Erik Veenstra
|
|
565
570
|
</div>
|
566
571
|
<div class="method">
|
567
572
|
<div class="title">
|
568
|
-
<a name="
|
573
|
+
<a name="M000459"></a><b>ideal_entropy</b>()
|
569
574
|
</div>
|
570
575
|
<div class="description">
|
571
576
|
<p>
|
572
577
|
Returns the maximum possible Shannon <a
|
573
|
-
href="Enumerable.html#
|
578
|
+
href="Enumerable.html#M000458">entropy</a> of the array with given size
|
574
579
|
assuming that it is an "order-0" source (each element is selected
|
575
580
|
independently of the next).
|
576
581
|
</p>
|
@@ -579,8 +584,8 @@ CREDIT: Derek
|
|
579
584
|
</p>
|
580
585
|
</div>
|
581
586
|
<div class="sourcecode">
|
582
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
583
|
-
<div id="
|
587
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000459_source')" id="l_M000459_source">+</a> ]</p>
|
588
|
+
<div id="M000459_source" class="dyn-source">
|
584
589
|
<pre>
|
585
590
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/entropy.rb, line 30</span>
|
586
591
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ideal_entropy</span>
|
@@ -594,7 +599,7 @@ CREDIT: Derek
|
|
594
599
|
</div>
|
595
600
|
<div class="method">
|
596
601
|
<div class="title">
|
597
|
-
<a name="
|
602
|
+
<a name="M000449"></a><b>inject!</b>(s) {|k, i| ...}
|
598
603
|
</div>
|
599
604
|
<div class="description">
|
600
605
|
<p>
|
@@ -602,7 +607,7 @@ A small variation of Inject that save one from having to return the
|
|
602
607
|
aggregating or memo argument.
|
603
608
|
</p>
|
604
609
|
<p>
|
605
|
-
Say you want to <a href="Enumerable.html#
|
610
|
+
Say you want to <a href="Enumerable.html#M000465">count</a> letters.
|
606
611
|
</p>
|
607
612
|
<pre>
|
608
613
|
some_text.inject!(Hash.new(0)) {|h,l| h[l] += 1}
|
@@ -618,8 +623,8 @@ CREDIT: David Black, Louis J Scoras
|
|
618
623
|
</p>
|
619
624
|
</div>
|
620
625
|
<div class="sourcecode">
|
621
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
622
|
-
<div id="
|
626
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000449_source')" id="l_M000449_source">+</a> ]</p>
|
627
|
+
<div id="M000449_source" class="dyn-source">
|
623
628
|
<pre>
|
624
629
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/inject.rb, line 16</span>
|
625
630
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inject!</span>(<span class="ruby-identifier">s</span>)
|
@@ -633,7 +638,7 @@ CREDIT: David Black, Louis J Scoras
|
|
633
638
|
</div>
|
634
639
|
<div class="method">
|
635
640
|
<div class="title">
|
636
|
-
<a name="
|
641
|
+
<a name="M000461"></a><b>map_send</b>(meth, *args, &block)
|
637
642
|
</div>
|
638
643
|
<div class="description">
|
639
644
|
<p>
|
@@ -644,8 +649,8 @@ CREDIT: Sean O‘Halpin
|
|
644
649
|
</p>
|
645
650
|
</div>
|
646
651
|
<div class="sourcecode">
|
647
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
648
|
-
<div id="
|
652
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000461_source')" id="l_M000461_source">+</a> ]</p>
|
653
|
+
<div id="M000461_source" class="dyn-source">
|
649
654
|
<pre>
|
650
655
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/map_send.rb, line 7</span>
|
651
656
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_send</span>(<span class="ruby-identifier">meth</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -657,7 +662,7 @@ CREDIT: Sean O‘Halpin
|
|
657
662
|
</div>
|
658
663
|
<div class="method">
|
659
664
|
<div class="title">
|
660
|
-
<a name="
|
665
|
+
<a name="M000463"></a><b>map_with_index</b>() {|self[i], i| ...}
|
661
666
|
</div>
|
662
667
|
<div class="description">
|
663
668
|
<p>
|
@@ -673,11 +678,11 @@ CREDIT: Gavin Sinclair
|
|
673
678
|
</div>
|
674
679
|
<div class="aka">
|
675
680
|
This method is also aliased as
|
676
|
-
<a href="Enumerable.html#
|
681
|
+
<a href="Enumerable.html#M000464">collect_with_index</a>
|
677
682
|
</div>
|
678
683
|
<div class="sourcecode">
|
679
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
680
|
-
<div id="
|
684
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000463_source')" id="l_M000463_source">+</a> ]</p>
|
685
|
+
<div id="M000463_source" class="dyn-source">
|
681
686
|
<pre>
|
682
687
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/map_with_index.rb, line 10</span>
|
683
688
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_with_index</span>
|
@@ -693,7 +698,7 @@ CREDIT: Gavin Sinclair
|
|
693
698
|
</div>
|
694
699
|
<div class="method">
|
695
700
|
<div class="title">
|
696
|
-
<a name="
|
701
|
+
<a name="M000455"></a><b>mash</b>(&yld)
|
697
702
|
</div>
|
698
703
|
<div class="description">
|
699
704
|
<p>
|
@@ -707,7 +712,7 @@ key and the value for the new hash.
|
|
707
712
|
sq_roots = numbers.mash { |n| [n*n, n] } # { 1=>1, 4=>2, 9=>3 }
|
708
713
|
</pre>
|
709
714
|
<p>
|
710
|
-
The name "<a href="Enumerable.html#
|
715
|
+
The name "<a href="Enumerable.html#M000455">mash</a>" stands for
|
711
716
|
"map hash".
|
712
717
|
</p>
|
713
718
|
<p>
|
@@ -716,11 +721,11 @@ CREDIT: Andrew Dudzik (adudzik), Trans
|
|
716
721
|
</div>
|
717
722
|
<div class="aka">
|
718
723
|
This method is also aliased as
|
719
|
-
<a href="Enumerable.html#
|
724
|
+
<a href="Enumerable.html#M000456">graph</a>
|
720
725
|
</div>
|
721
726
|
<div class="sourcecode">
|
722
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
723
|
-
<div id="
|
727
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000455_source')" id="l_M000455_source">+</a> ]</p>
|
728
|
+
<div id="M000455_source" class="dyn-source">
|
724
729
|
<pre>
|
725
730
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/mash.rb, line 14</span>
|
726
731
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mash</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">yld</span>)
|
@@ -741,11 +746,11 @@ CREDIT: Andrew Dudzik (adudzik), Trans
|
|
741
746
|
</div>
|
742
747
|
<div class="method">
|
743
748
|
<div class="title">
|
744
|
-
<a name="
|
749
|
+
<a name="M000444"></a><b>mode</b>()
|
745
750
|
</div>
|
746
751
|
<div class="description">
|
747
752
|
<p>
|
748
|
-
In Statistics <a href="Enumerable.html#
|
753
|
+
In Statistics <a href="Enumerable.html#M000444">mode</a> is the value that
|
749
754
|
occurs most frequently in a given set of data.
|
750
755
|
</p>
|
751
756
|
<p>
|
@@ -753,8 +758,8 @@ CREDIT: Robert Klemme
|
|
753
758
|
</p>
|
754
759
|
</div>
|
755
760
|
<div class="sourcecode">
|
756
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
757
|
-
<div id="
|
761
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000444_source')" id="l_M000444_source">+</a> ]</p>
|
762
|
+
<div id="M000444_source" class="dyn-source">
|
758
763
|
<pre>
|
759
764
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/mode.rb, line 8</span>
|
760
765
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mode</span>
|
@@ -769,14 +774,14 @@ CREDIT: Robert Klemme
|
|
769
774
|
</div>
|
770
775
|
<div class="method">
|
771
776
|
<div class="title">
|
772
|
-
<a name="
|
777
|
+
<a name="M000457"></a><b>modulate</b>(modulo)
|
773
778
|
</div>
|
774
779
|
<div class="description">
|
775
780
|
<p>
|
776
781
|
Modulate. Divide an array into groups by modulo of the index.
|
777
782
|
</p>
|
778
783
|
<p>
|
779
|
-
[2,4,6,8].<a href="Enumerable.html#
|
784
|
+
[2,4,6,8].<a href="Enumerable.html#M000457">modulate</a>(2) #=>
|
780
785
|
[[2,6],[4,8]]
|
781
786
|
</p>
|
782
787
|
<p>
|
@@ -787,8 +792,8 @@ NOTE: Would the better name for this be ‘collate’?
|
|
787
792
|
</p>
|
788
793
|
</div>
|
789
794
|
<div class="sourcecode">
|
790
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
791
|
-
<div id="
|
795
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000457_source')" id="l_M000457_source">+</a> ]</p>
|
796
|
+
<div id="M000457_source" class="dyn-source">
|
792
797
|
<pre>
|
793
798
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/modulate.rb, line 11</span>
|
794
799
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">modulate</span>(<span class="ruby-identifier">modulo</span>)
|
@@ -806,7 +811,7 @@ NOTE: Would the better name for this be ‘collate’?
|
|
806
811
|
</div>
|
807
812
|
<div class="method">
|
808
813
|
<div class="title">
|
809
|
-
<a name="
|
814
|
+
<a name="M000452"></a><b>none?</b>( {|e| ...}
|
810
815
|
</div>
|
811
816
|
<div class="description">
|
812
817
|
<p>
|
@@ -831,8 +836,8 @@ CREDIT: Gavin Sinclair
|
|
831
836
|
</p>
|
832
837
|
</div>
|
833
838
|
<div class="sourcecode">
|
834
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
835
|
-
<div id="
|
839
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000452_source')" id="l_M000452_source">+</a> ]</p>
|
840
|
+
<div id="M000452_source" class="dyn-source">
|
836
841
|
<pre>
|
837
842
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/none.rb, line 21</span>
|
838
843
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">none?</span> <span class="ruby-comment cmt"># :yield: e</span>
|
@@ -848,7 +853,7 @@ CREDIT: Gavin Sinclair
|
|
848
853
|
</div>
|
849
854
|
<div class="method">
|
850
855
|
<div class="title">
|
851
|
-
<a name="
|
856
|
+
<a name="M000450"></a><b>nonuniq</b>()
|
852
857
|
</div>
|
853
858
|
<div class="description">
|
854
859
|
<p>
|
@@ -863,11 +868,11 @@ CREDIT: Martin DeMello
|
|
863
868
|
</div>
|
864
869
|
<div class="aka">
|
865
870
|
This method is also aliased as
|
866
|
-
<a href="Enumerable.html#
|
871
|
+
<a href="Enumerable.html#M000451">duplicates</a>
|
867
872
|
</div>
|
868
873
|
<div class="sourcecode">
|
869
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
870
|
-
<div id="
|
874
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000450_source')" id="l_M000450_source">+</a> ]</p>
|
875
|
+
<div id="M000450_source" class="dyn-source">
|
871
876
|
<pre>
|
872
877
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/duplicates.rb, line 9</span>
|
873
878
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nonuniq</span>
|
@@ -885,12 +890,12 @@ CREDIT: Martin DeMello
|
|
885
890
|
</div>
|
886
891
|
<div class="method">
|
887
892
|
<div class="title">
|
888
|
-
<a name="
|
893
|
+
<a name="M000446"></a><b>occur</b>(n=nil) {|| ...}
|
889
894
|
</div>
|
890
895
|
<div class="description">
|
891
896
|
<p>
|
892
897
|
Returns an array of elements for the elements that <a
|
893
|
-
href="Enumerable.html#
|
898
|
+
href="Enumerable.html#M000446">occur</a> n times. Or according to the
|
894
899
|
results of a given block.
|
895
900
|
</p>
|
896
901
|
<pre>
|
@@ -906,8 +911,8 @@ results of a given block.
|
|
906
911
|
</pre>
|
907
912
|
</div>
|
908
913
|
<div class="sourcecode">
|
909
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
910
|
-
<div id="
|
914
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000446_source')" id="l_M000446_source">+</a> ]</p>
|
915
|
+
<div id="M000446_source" class="dyn-source">
|
911
916
|
<pre>
|
912
917
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/occur.rb, line 16</span>
|
913
918
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">occur</span>(<span class="ruby-identifier">n</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt">#:yield:</span>
|
@@ -934,7 +939,7 @@ results of a given block.
|
|
934
939
|
</div>
|
935
940
|
<div class="method">
|
936
941
|
<div class="title">
|
937
|
-
<a name="
|
942
|
+
<a name="M000440"></a><b>one?</b>( {|e| ...}
|
938
943
|
</div>
|
939
944
|
<div class="description">
|
940
945
|
<p>
|
@@ -959,8 +964,8 @@ CREDIT: Gavin Sinclair
|
|
959
964
|
</p>
|
960
965
|
</div>
|
961
966
|
<div class="sourcecode">
|
962
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
963
|
-
<div id="
|
967
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000440_source')" id="l_M000440_source">+</a> ]</p>
|
968
|
+
<div id="M000440_source" class="dyn-source">
|
964
969
|
<pre>
|
965
970
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/one.rb, line 21</span>
|
966
971
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">one?</span> <span class="ruby-comment cmt"># :yield: e</span>
|
@@ -983,12 +988,12 @@ CREDIT: Gavin Sinclair
|
|
983
988
|
</div>
|
984
989
|
<div class="method">
|
985
990
|
<div class="title">
|
986
|
-
<a name="
|
991
|
+
<a name="M000462"></a><b>probability</b>()
|
987
992
|
</div>
|
988
993
|
<div class="description">
|
989
994
|
<p>
|
990
995
|
Generates a hash mapping each unique element in the array to the relative
|
991
|
-
<a href="Enumerable.html#
|
996
|
+
<a href="Enumerable.html#M000447">frequency</a>, i.e. the probablity, of it
|
992
997
|
appearence.
|
993
998
|
</p>
|
994
999
|
<p>
|
@@ -996,8 +1001,8 @@ CREDIT: Brian Schröder
|
|
996
1001
|
</p>
|
997
1002
|
</div>
|
998
1003
|
<div class="sourcecode">
|
999
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1000
|
-
<div id="
|
1004
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000462_source')" id="l_M000462_source">+</a> ]</p>
|
1005
|
+
<div id="M000462_source" class="dyn-source">
|
1001
1006
|
<pre>
|
1002
1007
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/probability.rb, line 9</span>
|
1003
1008
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">probability</span>
|
@@ -1016,12 +1021,12 @@ CREDIT: Brian Schröder
|
|
1016
1021
|
</div>
|
1017
1022
|
<div class="method">
|
1018
1023
|
<div class="title">
|
1019
|
-
<a name="
|
1024
|
+
<a name="M000460"></a><b>split</b>(pattern)
|
1020
1025
|
</div>
|
1021
1026
|
<div class="description">
|
1022
1027
|
<p>
|
1023
1028
|
Split on matching pattern. Unlike <a
|
1024
|
-
href="Enumerable.html#
|
1029
|
+
href="Enumerable.html#M000448">divide</a> this does not include matching
|
1025
1030
|
elements.
|
1026
1031
|
</p>
|
1027
1032
|
<pre>
|
@@ -1033,8 +1038,8 @@ CREDIT: Trans
|
|
1033
1038
|
</p>
|
1034
1039
|
</div>
|
1035
1040
|
<div class="sourcecode">
|
1036
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1037
|
-
<div id="
|
1041
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000460_source')" id="l_M000460_source">+</a> ]</p>
|
1042
|
+
<div id="M000460_source" class="dyn-source">
|
1038
1043
|
<pre>
|
1039
1044
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/split.rb, line 10</span>
|
1040
1045
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split</span>(<span class="ruby-identifier">pattern</span>)
|
@@ -1058,11 +1063,11 @@ CREDIT: Trans
|
|
1058
1063
|
</div>
|
1059
1064
|
<div class="method">
|
1060
1065
|
<div class="title">
|
1061
|
-
<a name="
|
1066
|
+
<a name="M000443"></a><b>sum</b>(identity = 0, &block)
|
1062
1067
|
</div>
|
1063
1068
|
<div class="description">
|
1064
1069
|
<p>
|
1065
|
-
Uses #+ to <a href="Enumerable.html#
|
1070
|
+
Uses #+ to <a href="Enumerable.html#M000443">sum</a> the enumerated
|
1066
1071
|
elements.
|
1067
1072
|
</p>
|
1068
1073
|
<pre>
|
@@ -1071,8 +1076,8 @@ elements.
|
|
1071
1076
|
</pre>
|
1072
1077
|
</div>
|
1073
1078
|
<div class="sourcecode">
|
1074
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1075
|
-
<div id="
|
1079
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000443_source')" id="l_M000443_source">+</a> ]</p>
|
1080
|
+
<div id="M000443_source" class="dyn-source">
|
1076
1081
|
<pre>
|
1077
1082
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/sum.rb, line 8</span>
|
1078
1083
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sum</span>(<span class="ruby-identifier">identity</span> = <span class="ruby-value">0</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -1088,7 +1093,7 @@ elements.
|
|
1088
1093
|
</div>
|
1089
1094
|
<div class="method">
|
1090
1095
|
<div class="title">
|
1091
|
-
<a name="
|
1096
|
+
<a name="M000439"></a><b>take</b>(n)
|
1092
1097
|
</div>
|
1093
1098
|
<div class="description">
|
1094
1099
|
<p>
|
@@ -1096,8 +1101,8 @@ Return the first n items from the collection
|
|
1096
1101
|
</p>
|
1097
1102
|
</div>
|
1098
1103
|
<div class="sourcecode">
|
1099
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1100
|
-
<div id="
|
1104
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000439_source')" id="l_M000439_source">+</a> ]</p>
|
1105
|
+
<div id="M000439_source" class="dyn-source">
|
1101
1106
|
<pre>
|
1102
1107
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/take.rb, line 7</span>
|
1103
1108
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take</span>(<span class="ruby-identifier">n</span>)
|
@@ -1116,7 +1121,7 @@ Return the first n items from the collection
|
|
1116
1121
|
</div>
|
1117
1122
|
<div class="method">
|
1118
1123
|
<div class="title">
|
1119
|
-
<a name="
|
1124
|
+
<a name="M000433"></a><b>to_h</b>(mode=nil)
|
1120
1125
|
</div>
|
1121
1126
|
<div class="description">
|
1122
1127
|
<p>
|
@@ -1128,10 +1133,10 @@ CREDIT: Trans
|
|
1128
1133
|
</p>
|
1129
1134
|
</div>
|
1130
1135
|
<div class="sourcecode">
|
1131
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1132
|
-
<div id="
|
1136
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000433_source')" id="l_M000433_source">+</a> ]</p>
|
1137
|
+
<div id="M000433_source" class="dyn-source">
|
1133
1138
|
<pre>
|
1134
|
-
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line
|
1139
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 226</span>
|
1135
1140
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>(<span class="ruby-identifier">mode</span>=<span class="ruby-keyword kw">nil</span>)
|
1136
1141
|
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h</span>(<span class="ruby-identifier">mode</span>)
|
1137
1142
|
<span class="ruby-keyword kw">end</span>
|
@@ -1141,7 +1146,87 @@ CREDIT: Trans
|
|
1141
1146
|
</div>
|
1142
1147
|
<div class="method">
|
1143
1148
|
<div class="title">
|
1144
|
-
<a name="
|
1149
|
+
<a name="M000437"></a><b>to_h_assoc</b>()
|
1150
|
+
</div>
|
1151
|
+
<div class="sourcecode">
|
1152
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000437_source')" id="l_M000437_source">+</a> ]</p>
|
1153
|
+
<div id="M000437_source" class="dyn-source">
|
1154
|
+
<pre>
|
1155
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 242</span>
|
1156
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_assoc</span>
|
1157
|
+
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_assoc</span>
|
1158
|
+
<span class="ruby-keyword kw">end</span>
|
1159
|
+
</pre>
|
1160
|
+
</div>
|
1161
|
+
</div>
|
1162
|
+
</div>
|
1163
|
+
<div class="method">
|
1164
|
+
<div class="title">
|
1165
|
+
<a name="M000434"></a><b>to_h_auto</b>()
|
1166
|
+
</div>
|
1167
|
+
<div class="sourcecode">
|
1168
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000434_source')" id="l_M000434_source">+</a> ]</p>
|
1169
|
+
<div id="M000434_source" class="dyn-source">
|
1170
|
+
<pre>
|
1171
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 230</span>
|
1172
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_auto</span>
|
1173
|
+
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_auto</span>
|
1174
|
+
<span class="ruby-keyword kw">end</span>
|
1175
|
+
</pre>
|
1176
|
+
</div>
|
1177
|
+
</div>
|
1178
|
+
</div>
|
1179
|
+
<div class="method">
|
1180
|
+
<div class="title">
|
1181
|
+
<a name="M000436"></a><b>to_h_flat</b>()
|
1182
|
+
</div>
|
1183
|
+
<div class="sourcecode">
|
1184
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000436_source')" id="l_M000436_source">+</a> ]</p>
|
1185
|
+
<div id="M000436_source" class="dyn-source">
|
1186
|
+
<pre>
|
1187
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 238</span>
|
1188
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_flat</span>
|
1189
|
+
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_flat</span>
|
1190
|
+
<span class="ruby-keyword kw">end</span>
|
1191
|
+
</pre>
|
1192
|
+
</div>
|
1193
|
+
</div>
|
1194
|
+
</div>
|
1195
|
+
<div class="method">
|
1196
|
+
<div class="title">
|
1197
|
+
<a name="M000438"></a><b>to_h_multi</b>()
|
1198
|
+
</div>
|
1199
|
+
<div class="sourcecode">
|
1200
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000438_source')" id="l_M000438_source">+</a> ]</p>
|
1201
|
+
<div id="M000438_source" class="dyn-source">
|
1202
|
+
<pre>
|
1203
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 246</span>
|
1204
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_multi</span>
|
1205
|
+
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_multi</span>
|
1206
|
+
<span class="ruby-keyword kw">end</span>
|
1207
|
+
</pre>
|
1208
|
+
</div>
|
1209
|
+
</div>
|
1210
|
+
</div>
|
1211
|
+
<div class="method">
|
1212
|
+
<div class="title">
|
1213
|
+
<a name="M000435"></a><b>to_h_splat</b>()
|
1214
|
+
</div>
|
1215
|
+
<div class="sourcecode">
|
1216
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000435_source')" id="l_M000435_source">+</a> ]</p>
|
1217
|
+
<div id="M000435_source" class="dyn-source">
|
1218
|
+
<pre>
|
1219
|
+
<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 234</span>
|
1220
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_splat</span>
|
1221
|
+
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_splat</span>
|
1222
|
+
<span class="ruby-keyword kw">end</span>
|
1223
|
+
</pre>
|
1224
|
+
</div>
|
1225
|
+
</div>
|
1226
|
+
</div>
|
1227
|
+
<div class="method">
|
1228
|
+
<div class="title">
|
1229
|
+
<a name="M000453"></a><b>uniq_by</b>( {|| ...}
|
1145
1230
|
</div>
|
1146
1231
|
<div class="description">
|
1147
1232
|
<p>
|
@@ -1158,8 +1243,8 @@ produces
|
|
1158
1243
|
</pre>
|
1159
1244
|
</div>
|
1160
1245
|
<div class="sourcecode">
|
1161
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1162
|
-
<div id="
|
1246
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000453_source')" id="l_M000453_source">+</a> ]</p>
|
1247
|
+
<div id="M000453_source" class="dyn-source">
|
1163
1248
|
<pre>
|
1164
1249
|
<span class="ruby-comment cmt"># File lib/core/facets/enumerable/uniq_by.rb, line 11</span>
|
1165
1250
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uniq_by</span> <span class="ruby-comment cmt">#:yield:</span>
|