mack_ruby_core_extensions 0.1.24 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/classes/Array.html +74 -74
- data/doc/classes/Class.html +18 -18
- data/doc/classes/Float.html +6 -6
- data/doc/classes/Hash.html +53 -0
- data/doc/classes/Kernel.html +12 -12
- data/doc/classes/Mack/Utils/Inflector.html +56 -56
- data/doc/classes/Math.html +18 -18
- data/doc/classes/MethodNotImplemented.html +6 -6
- data/doc/classes/Module.html +12 -12
- data/doc/classes/NilClass.html +6 -6
- data/doc/classes/Object.html +56 -56
- data/doc/classes/String.html +162 -162
- data/doc/created.rid +1 -1
- data/doc/files/lib/extensions/hash_rb.html +1 -1
- data/doc/fr_method_index.html +69 -67
- data/lib/extensions/hash.rb +13 -0
- data/test/extensions/hash_test.rb +14 -0
- metadata +1 -1
data/doc/classes/Array.html
CHANGED
@@ -88,17 +88,17 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
91
|
+
<a href="#M000016">count</a>
|
92
|
+
<a href="#M000008">delete_from_array</a>
|
93
|
+
<a href="#M000009">delete_from_array!</a>
|
94
|
+
<a href="#M000017">invert</a>
|
95
|
+
<a href="#M000007">parse_splat_args</a>
|
96
|
+
<a href="#M000012">pick_random</a>
|
97
|
+
<a href="#M000013">random_each</a>
|
98
|
+
<a href="#M000010">randomize</a>
|
99
|
+
<a href="#M000011">randomize!</a>
|
100
|
+
<a href="#M000014">subset?</a>
|
101
|
+
<a href="#M000015">superset?</a>
|
102
102
|
</div>
|
103
103
|
</div>
|
104
104
|
|
@@ -120,26 +120,26 @@
|
|
120
120
|
<div id="methods">
|
121
121
|
<h3 class="section-bar">Public Instance methods</h3>
|
122
122
|
|
123
|
-
<div id="method-
|
124
|
-
<a name="
|
123
|
+
<div id="method-M000016" class="method-detail">
|
124
|
+
<a name="M000016"></a>
|
125
125
|
|
126
126
|
<div class="method-heading">
|
127
|
-
<a href="#
|
127
|
+
<a href="#M000016" class="method-signature">
|
128
128
|
<span class="method-name">count</span><span class="method-args">()</span>
|
129
129
|
</a>
|
130
130
|
</div>
|
131
131
|
|
132
132
|
<div class="method-description">
|
133
133
|
<p>
|
134
|
-
This will give you a <a href="Array.html#
|
134
|
+
This will give you a <a href="Array.html#M000016">count</a>, as a <a
|
135
135
|
href="Hash.html">Hash</a>, of all the values in the <a
|
136
136
|
href="Array.html">Array</a>. %w{spam spam eggs ham eggs spam}.<a
|
137
|
-
href="Array.html#
|
137
|
+
href="Array.html#M000016">count</a> # => {"eggs" => 2,
|
138
138
|
"ham" => 1, "spam" => 3}
|
139
139
|
</p>
|
140
140
|
<p><a class="source-toggle" href="#"
|
141
|
-
onclick="toggleCode('
|
142
|
-
<div class="method-source-code" id="
|
141
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
142
|
+
<div class="method-source-code" id="M000016-source">
|
143
143
|
<pre>
|
144
144
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 87</span>
|
145
145
|
87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>
|
@@ -152,11 +152,11 @@ href="Array.html#M000014">count</a> # => {"eggs" => 2,
|
|
152
152
|
</div>
|
153
153
|
</div>
|
154
154
|
|
155
|
-
<div id="method-
|
156
|
-
<a name="
|
155
|
+
<div id="method-M000008" class="method-detail">
|
156
|
+
<a name="M000008"></a>
|
157
157
|
|
158
158
|
<div class="method-heading">
|
159
|
-
<a href="#
|
159
|
+
<a href="#M000008" class="method-signature">
|
160
160
|
<span class="method-name">delete_from_array</span><span class="method-args">(args)</span>
|
161
161
|
</a>
|
162
162
|
</div>
|
@@ -164,12 +164,12 @@ href="Array.html#M000014">count</a> # => {"eggs" => 2,
|
|
164
164
|
<div class="method-description">
|
165
165
|
<p>
|
166
166
|
This allows you to delete an array of values from another array.
|
167
|
-
[1,2,3,4,5].<a href="Array.html#
|
167
|
+
[1,2,3,4,5].<a href="Array.html#M000008">delete_from_array</a>([2,3,5]) #
|
168
168
|
=> [1,4]
|
169
169
|
</p>
|
170
170
|
<p><a class="source-toggle" href="#"
|
171
|
-
onclick="toggleCode('
|
172
|
-
<div class="method-source-code" id="
|
171
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000008-source">
|
173
173
|
<pre>
|
174
174
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 37</span>
|
175
175
|
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_from_array</span>(<span class="ruby-identifier">args</span>)
|
@@ -180,23 +180,23 @@ This allows you to delete an array of values from another array.
|
|
180
180
|
</div>
|
181
181
|
</div>
|
182
182
|
|
183
|
-
<div id="method-
|
184
|
-
<a name="
|
183
|
+
<div id="method-M000009" class="method-detail">
|
184
|
+
<a name="M000009"></a>
|
185
185
|
|
186
186
|
<div class="method-heading">
|
187
|
-
<a href="#
|
187
|
+
<a href="#M000009" class="method-signature">
|
188
188
|
<span class="method-name">delete_from_array!</span><span class="method-args">(args)</span>
|
189
189
|
</a>
|
190
190
|
</div>
|
191
191
|
|
192
192
|
<div class="method-description">
|
193
193
|
<p>
|
194
|
-
This calls the <a href="Array.html#
|
194
|
+
This calls the <a href="Array.html#M000008">delete_from_array</a> method,
|
195
195
|
but will permantly replace the existing array.
|
196
196
|
</p>
|
197
197
|
<p><a class="source-toggle" href="#"
|
198
|
-
onclick="toggleCode('
|
199
|
-
<div class="method-source-code" id="
|
198
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
199
|
+
<div class="method-source-code" id="M000009-source">
|
200
200
|
<pre>
|
201
201
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 42</span>
|
202
202
|
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_from_array!</span>(<span class="ruby-identifier">args</span>)
|
@@ -207,25 +207,25 @@ but will permantly replace the existing array.
|
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000017" class="method-detail">
|
211
|
+
<a name="M000017"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="#
|
214
|
+
<a href="#M000017" class="method-signature">
|
215
215
|
<span class="method-name">invert</span><span class="method-args">()</span>
|
216
216
|
</a>
|
217
217
|
</div>
|
218
218
|
|
219
219
|
<div class="method-description">
|
220
220
|
<p>
|
221
|
-
This will <a href="Array.html#
|
221
|
+
This will <a href="Array.html#M000017">invert</a> the index and the values
|
222
222
|
and return a <a href="Hash.html">Hash</a> of the results. %w{red yellow
|
223
|
-
orange}.<a href="Array.html#
|
223
|
+
orange}.<a href="Array.html#M000017">invert</a> # => {"red"
|
224
224
|
=> 0, "orange" => 2, "yellow" => 1}
|
225
225
|
</p>
|
226
226
|
<p><a class="source-toggle" href="#"
|
227
|
-
onclick="toggleCode('
|
228
|
-
<div class="method-source-code" id="
|
227
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
228
|
+
<div class="method-source-code" id="M000017-source">
|
229
229
|
<pre>
|
230
230
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 95</span>
|
231
231
|
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invert</span>
|
@@ -238,11 +238,11 @@ orange}.<a href="Array.html#M000015">invert</a> # => {"red"
|
|
238
238
|
</div>
|
239
239
|
</div>
|
240
240
|
|
241
|
-
<div id="method-
|
242
|
-
<a name="
|
241
|
+
<div id="method-M000007" class="method-detail">
|
242
|
+
<a name="M000007"></a>
|
243
243
|
|
244
244
|
<div class="method-heading">
|
245
|
-
<a href="#
|
245
|
+
<a href="#M000007" class="method-signature">
|
246
246
|
<span class="method-name">parse_splat_args</span><span class="method-args">()</span>
|
247
247
|
</a>
|
248
248
|
</div>
|
@@ -259,15 +259,15 @@ foo(*args)
|
|
259
259
|
end The problem is when you use the * like that everything that comes in is
|
260
260
|
an array. Here are a few problems with this: foo([1,2,3]) When you pass an
|
261
261
|
array into this type of method you get the following nested array:
|
262
|
-
[[1,2,3]] The <a href="Array.html#
|
262
|
+
[[1,2,3]] The <a href="Array.html#M000007">parse_splat_args</a> method, if
|
263
263
|
called, would do this: args.parse_splat_args # => [1,2,3] Now say you
|
264
264
|
called this method like such: foo(1) args would be [1]
|
265
265
|
args.parse_splat_args # => 1 Finally foo args.parse_splat_args # =>
|
266
266
|
nil
|
267
267
|
</p>
|
268
268
|
<p><a class="source-toggle" href="#"
|
269
|
-
onclick="toggleCode('
|
270
|
-
<div class="method-source-code" id="
|
269
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
270
|
+
<div class="method-source-code" id="M000007-source">
|
271
271
|
<pre>
|
272
272
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 21</span>
|
273
273
|
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_splat_args</span>
|
@@ -288,11 +288,11 @@ nil
|
|
288
288
|
</div>
|
289
289
|
</div>
|
290
290
|
|
291
|
-
<div id="method-
|
292
|
-
<a name="
|
291
|
+
<div id="method-M000012" class="method-detail">
|
292
|
+
<a name="M000012"></a>
|
293
293
|
|
294
294
|
<div class="method-heading">
|
295
|
-
<a href="#
|
295
|
+
<a href="#M000012" class="method-signature">
|
296
296
|
<span class="method-name">pick_random</span><span class="method-args">()</span>
|
297
297
|
</a>
|
298
298
|
</div>
|
@@ -302,8 +302,8 @@ nil
|
|
302
302
|
This will pick a random value from the array
|
303
303
|
</p>
|
304
304
|
<p><a class="source-toggle" href="#"
|
305
|
-
onclick="toggleCode('
|
306
|
-
<div class="method-source-code" id="
|
305
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
306
|
+
<div class="method-source-code" id="M000012-source">
|
307
307
|
<pre>
|
308
308
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 65</span>
|
309
309
|
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pick_random</span>
|
@@ -314,11 +314,11 @@ This will pick a random value from the array
|
|
314
314
|
</div>
|
315
315
|
</div>
|
316
316
|
|
317
|
-
<div id="method-
|
318
|
-
<a name="
|
317
|
+
<div id="method-M000013" class="method-detail">
|
318
|
+
<a name="M000013"></a>
|
319
319
|
|
320
320
|
<div class="method-heading">
|
321
|
-
<a href="#
|
321
|
+
<a href="#M000013" class="method-signature">
|
322
322
|
<span class="method-name">random_each</span><span class="method-args">() {|x| ...}</span>
|
323
323
|
</a>
|
324
324
|
</div>
|
@@ -328,8 +328,8 @@ This will pick a random value from the array
|
|
328
328
|
This allows you to easily recurse of the array randomly.
|
329
329
|
</p>
|
330
330
|
<p><a class="source-toggle" href="#"
|
331
|
-
onclick="toggleCode('
|
332
|
-
<div class="method-source-code" id="
|
331
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
332
|
+
<div class="method-source-code" id="M000013-source">
|
333
333
|
<pre>
|
334
334
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 70</span>
|
335
335
|
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">random_each</span>
|
@@ -340,11 +340,11 @@ This allows you to easily recurse of the array randomly.
|
|
340
340
|
</div>
|
341
341
|
</div>
|
342
342
|
|
343
|
-
<div id="method-
|
344
|
-
<a name="
|
343
|
+
<div id="method-M000010" class="method-detail">
|
344
|
+
<a name="M000010"></a>
|
345
345
|
|
346
346
|
<div class="method-heading">
|
347
|
-
<a href="#
|
347
|
+
<a href="#M000010" class="method-signature">
|
348
348
|
<span class="method-name">randomize</span><span class="method-args">() {|x, y| ...}</span>
|
349
349
|
</a>
|
350
350
|
</div>
|
@@ -354,8 +354,8 @@ This allows you to easily recurse of the array randomly.
|
|
354
354
|
This will return a new instance of the array sorted randomly.
|
355
355
|
</p>
|
356
356
|
<p><a class="source-toggle" href="#"
|
357
|
-
onclick="toggleCode('
|
358
|
-
<div class="method-source-code" id="
|
357
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
358
|
+
<div class="method-source-code" id="M000010-source">
|
359
359
|
<pre>
|
360
360
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 47</span>
|
361
361
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">randomize</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -370,23 +370,23 @@ This will return a new instance of the array sorted randomly.
|
|
370
370
|
</div>
|
371
371
|
</div>
|
372
372
|
|
373
|
-
<div id="method-
|
374
|
-
<a name="
|
373
|
+
<div id="method-M000011" class="method-detail">
|
374
|
+
<a name="M000011"></a>
|
375
375
|
|
376
376
|
<div class="method-heading">
|
377
|
-
<a href="#
|
377
|
+
<a href="#M000011" class="method-signature">
|
378
378
|
<span class="method-name">randomize!</span><span class="method-args">(&block)</span>
|
379
379
|
</a>
|
380
380
|
</div>
|
381
381
|
|
382
382
|
<div class="method-description">
|
383
383
|
<p>
|
384
|
-
This calls the <a href="Array.html#
|
384
|
+
This calls the <a href="Array.html#M000010">randomize</a> method, but will
|
385
385
|
permantly replace the existing array.
|
386
386
|
</p>
|
387
387
|
<p><a class="source-toggle" href="#"
|
388
|
-
onclick="toggleCode('
|
389
|
-
<div class="method-source-code" id="
|
388
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
389
|
+
<div class="method-source-code" id="M000011-source">
|
390
390
|
<pre>
|
391
391
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 56</span>
|
392
392
|
56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">randomize!</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -401,19 +401,19 @@ permantly replace the existing array.
|
|
401
401
|
</div>
|
402
402
|
</div>
|
403
403
|
|
404
|
-
<div id="method-
|
405
|
-
<a name="
|
404
|
+
<div id="method-M000014" class="method-detail">
|
405
|
+
<a name="M000014"></a>
|
406
406
|
|
407
407
|
<div class="method-heading">
|
408
|
-
<a href="#
|
408
|
+
<a href="#M000014" class="method-signature">
|
409
409
|
<span class="method-name">subset?</span><span class="method-args">(other)</span>
|
410
410
|
</a>
|
411
411
|
</div>
|
412
412
|
|
413
413
|
<div class="method-description">
|
414
414
|
<p><a class="source-toggle" href="#"
|
415
|
-
onclick="toggleCode('
|
416
|
-
<div class="method-source-code" id="
|
415
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
416
|
+
<div class="method-source-code" id="M000014-source">
|
417
417
|
<pre>
|
418
418
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 74</span>
|
419
419
|
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subset?</span>(<span class="ruby-identifier">other</span>)
|
@@ -427,19 +427,19 @@ permantly replace the existing array.
|
|
427
427
|
</div>
|
428
428
|
</div>
|
429
429
|
|
430
|
-
<div id="method-
|
431
|
-
<a name="
|
430
|
+
<div id="method-M000015" class="method-detail">
|
431
|
+
<a name="M000015"></a>
|
432
432
|
|
433
433
|
<div class="method-heading">
|
434
|
-
<a href="#
|
434
|
+
<a href="#M000015" class="method-signature">
|
435
435
|
<span class="method-name">superset?</span><span class="method-args">(other)</span>
|
436
436
|
</a>
|
437
437
|
</div>
|
438
438
|
|
439
439
|
<div class="method-description">
|
440
440
|
<p><a class="source-toggle" href="#"
|
441
|
-
onclick="toggleCode('
|
442
|
-
<div class="method-source-code" id="
|
441
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
442
|
+
<div class="method-source-code" id="M000015-source">
|
443
443
|
<pre>
|
444
444
|
<span class="ruby-comment cmt"># File lib/extensions/array.rb, line 81</span>
|
445
445
|
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">superset?</span>(<span class="ruby-identifier">other</span>)
|
data/doc/classes/Class.html
CHANGED
@@ -88,9 +88,9 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
91
|
+
<a href="#M000023">class_is_a?</a>
|
92
|
+
<a href="#M000022">new_instance_of</a>
|
93
|
+
<a href="#M000024">parents</a>
|
94
94
|
</div>
|
95
95
|
</div>
|
96
96
|
|
@@ -112,11 +112,11 @@
|
|
112
112
|
<div id="methods">
|
113
113
|
<h3 class="section-bar">Public Class methods</h3>
|
114
114
|
|
115
|
-
<div id="method-
|
116
|
-
<a name="
|
115
|
+
<div id="method-M000022" class="method-detail">
|
116
|
+
<a name="M000022"></a>
|
117
117
|
|
118
118
|
<div class="method-heading">
|
119
|
-
<a href="#
|
119
|
+
<a href="#M000022" class="method-signature">
|
120
120
|
<span class="method-name">new_instance_of</span><span class="method-args">(klass_name)</span>
|
121
121
|
</a>
|
122
122
|
</div>
|
@@ -134,8 +134,8 @@ Examples:
|
|
134
134
|
Class.new_instance_of("Animals::Dog") => #<Animals::Dog:0x376a2c>
|
135
135
|
</pre>
|
136
136
|
<p><a class="source-toggle" href="#"
|
137
|
-
onclick="toggleCode('
|
138
|
-
<div class="method-source-code" id="
|
137
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000022-source">
|
139
139
|
<pre>
|
140
140
|
<span class="ruby-comment cmt"># File lib/extensions/class.rb, line 8</span>
|
141
141
|
8: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new_instance_of</span>(<span class="ruby-identifier">klass_name</span>)
|
@@ -148,11 +148,11 @@ Examples:
|
|
148
148
|
|
149
149
|
<h3 class="section-bar">Public Instance methods</h3>
|
150
150
|
|
151
|
-
<div id="method-
|
152
|
-
<a name="
|
151
|
+
<div id="method-M000023" class="method-detail">
|
152
|
+
<a name="M000023"></a>
|
153
153
|
|
154
154
|
<div class="method-heading">
|
155
|
-
<a href="#
|
155
|
+
<a href="#M000023" class="method-signature">
|
156
156
|
<span class="method-name">class_is_a?</span><span class="method-args">(klass_name)</span>
|
157
157
|
</a>
|
158
158
|
</div>
|
@@ -163,8 +163,8 @@ This will through the ancestor tree of object and tell you if that object
|
|
163
163
|
is of the specified type.
|
164
164
|
</p>
|
165
165
|
<p><a class="source-toggle" href="#"
|
166
|
-
onclick="toggleCode('
|
167
|
-
<div class="method-source-code" id="
|
166
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
167
|
+
<div class="method-source-code" id="M000023-source">
|
168
168
|
<pre>
|
169
169
|
<span class="ruby-comment cmt"># File lib/extensions/class.rb, line 14</span>
|
170
170
|
14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_is_a?</span>(<span class="ruby-identifier">klass_name</span>)
|
@@ -180,11 +180,11 @@ is of the specified type.
|
|
180
180
|
</div>
|
181
181
|
</div>
|
182
182
|
|
183
|
-
<div id="method-
|
184
|
-
<a name="
|
183
|
+
<div id="method-M000024" class="method-detail">
|
184
|
+
<a name="M000024"></a>
|
185
185
|
|
186
186
|
<div class="method-heading">
|
187
|
-
<a href="#
|
187
|
+
<a href="#M000024" class="method-signature">
|
188
188
|
<span class="method-name">parents</span><span class="method-args">()</span>
|
189
189
|
</a>
|
190
190
|
</div>
|
@@ -202,8 +202,8 @@ Examples:
|
|
202
202
|
Fruit.parents # => [Object]
|
203
203
|
</pre>
|
204
204
|
<p><a class="source-toggle" href="#"
|
205
|
-
onclick="toggleCode('
|
206
|
-
<div class="method-source-code" id="
|
205
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
206
|
+
<div class="method-source-code" id="M000024-source">
|
207
207
|
<pre>
|
208
208
|
<span class="ruby-comment cmt"># File lib/extensions/class.rb, line 29</span>
|
209
209
|
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parents</span>
|
data/doc/classes/Float.html
CHANGED
@@ -88,7 +88,7 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
91
|
+
<a href="#M000021">prec</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -110,19 +110,19 @@
|
|
110
110
|
<div id="methods">
|
111
111
|
<h3 class="section-bar">Public Instance methods</h3>
|
112
112
|
|
113
|
-
<div id="method-
|
114
|
-
<a name="
|
113
|
+
<div id="method-M000021" class="method-detail">
|
114
|
+
<a name="M000021"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="#
|
117
|
+
<a href="#M000021" class="method-signature">
|
118
118
|
<span class="method-name">prec</span><span class="method-args">(x)</span>
|
119
119
|
</a>
|
120
120
|
</div>
|
121
121
|
|
122
122
|
<div class="method-description">
|
123
123
|
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('
|
125
|
-
<div class="method-source-code" id="
|
124
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
125
|
+
<div class="method-source-code" id="M000021-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/extensions/float.rb, line 3</span>
|
128
128
|
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prec</span>(<span class="ruby-identifier">x</span>)
|
data/doc/classes/Hash.html
CHANGED
@@ -90,6 +90,8 @@
|
|
90
90
|
<div class="name-list">
|
91
91
|
<a href="#M000003">-</a>
|
92
92
|
<a href="#M000002">join</a>
|
93
|
+
<a href="#M000005">symbolize_keys</a>
|
94
|
+
<a href="#M000006">symbolize_keys!</a>
|
93
95
|
<a href="#M000004">to_params</a>
|
94
96
|
</div>
|
95
97
|
</div>
|
@@ -167,6 +169,57 @@ Deletes the key(s) passed in from the hash.
|
|
167
169
|
</div>
|
168
170
|
</div>
|
169
171
|
|
172
|
+
<div id="method-M000005" class="method-detail">
|
173
|
+
<a name="M000005"></a>
|
174
|
+
|
175
|
+
<div class="method-heading">
|
176
|
+
<a href="#M000005" class="method-signature">
|
177
|
+
<span class="method-name">symbolize_keys</span><span class="method-args">()</span>
|
178
|
+
</a>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="method-description">
|
182
|
+
<p><a class="source-toggle" href="#"
|
183
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
184
|
+
<div class="method-source-code" id="M000005-source">
|
185
|
+
<pre>
|
186
|
+
<span class="ruby-comment cmt"># File lib/extensions/hash.rb, line 49</span>
|
187
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">symbolize_keys</span>
|
188
|
+
50: <span class="ruby-identifier">n</span> = {}
|
189
|
+
51: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
190
|
+
52: <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
191
|
+
53: <span class="ruby-identifier">n</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
192
|
+
54: <span class="ruby-keyword kw">end</span>
|
193
|
+
55: <span class="ruby-identifier">n</span>
|
194
|
+
56: <span class="ruby-keyword kw">end</span>
|
195
|
+
</pre>
|
196
|
+
</div>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div id="method-M000006" class="method-detail">
|
201
|
+
<a name="M000006"></a>
|
202
|
+
|
203
|
+
<div class="method-heading">
|
204
|
+
<a href="#M000006" class="method-signature">
|
205
|
+
<span class="method-name">symbolize_keys!</span><span class="method-args">()</span>
|
206
|
+
</a>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div class="method-description">
|
210
|
+
<p><a class="source-toggle" href="#"
|
211
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
212
|
+
<div class="method-source-code" id="M000006-source">
|
213
|
+
<pre>
|
214
|
+
<span class="ruby-comment cmt"># File lib/extensions/hash.rb, line 58</span>
|
215
|
+
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">symbolize_keys!</span>
|
216
|
+
59: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">symbolize_keys</span>)
|
217
|
+
60: <span class="ruby-keyword kw">end</span>
|
218
|
+
</pre>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
|
170
223
|
<div id="method-M000004" class="method-detail">
|
171
224
|
<a name="M000004"></a>
|
172
225
|
|
data/doc/classes/Kernel.html
CHANGED
@@ -80,8 +80,8 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
83
|
+
<a href="#M000069">pp_to_s</a>
|
84
|
+
<a href="#M000070">retryable</a>
|
85
85
|
</div>
|
86
86
|
</div>
|
87
87
|
|
@@ -103,19 +103,19 @@
|
|
103
103
|
<div id="methods">
|
104
104
|
<h3 class="section-bar">Public Instance methods</h3>
|
105
105
|
|
106
|
-
<div id="method-
|
107
|
-
<a name="
|
106
|
+
<div id="method-M000069" class="method-detail">
|
107
|
+
<a name="M000069"></a>
|
108
108
|
|
109
109
|
<div class="method-heading">
|
110
|
-
<a href="#
|
110
|
+
<a href="#M000069" class="method-signature">
|
111
111
|
<span class="method-name">pp_to_s</span><span class="method-args">(object)</span>
|
112
112
|
</a>
|
113
113
|
</div>
|
114
114
|
|
115
115
|
<div class="method-description">
|
116
116
|
<p><a class="source-toggle" href="#"
|
117
|
-
onclick="toggleCode('
|
118
|
-
<div class="method-source-code" id="
|
117
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
118
|
+
<div class="method-source-code" id="M000069-source">
|
119
119
|
<pre>
|
120
120
|
<span class="ruby-comment cmt"># File lib/extensions/kernel.rb, line 6</span>
|
121
121
|
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pp_to_s</span>(<span class="ruby-identifier">object</span>)
|
@@ -128,19 +128,19 @@
|
|
128
128
|
</div>
|
129
129
|
</div>
|
130
130
|
|
131
|
-
<div id="method-
|
132
|
-
<a name="
|
131
|
+
<div id="method-M000070" class="method-detail">
|
132
|
+
<a name="M000070"></a>
|
133
133
|
|
134
134
|
<div class="method-heading">
|
135
|
-
<a href="#
|
135
|
+
<a href="#M000070" class="method-signature">
|
136
136
|
<span class="method-name">retryable</span><span class="method-args">(options = {}, &block)</span>
|
137
137
|
</a>
|
138
138
|
</div>
|
139
139
|
|
140
140
|
<div class="method-description">
|
141
141
|
<p><a class="source-toggle" href="#"
|
142
|
-
onclick="toggleCode('
|
143
|
-
<div class="method-source-code" id="
|
142
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000070-source">
|
144
144
|
<pre>
|
145
145
|
<span class="ruby-comment cmt"># File lib/extensions/kernel.rb, line 12</span>
|
146
146
|
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retryable</span>(<span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|