lazier 1.0.7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/README.md +5 -2
- data/doc/Lazier.html +472 -174
- data/doc/Lazier/Boolean.html +9 -11
- data/doc/Lazier/DateTime.html +59 -113
- data/doc/Lazier/DateTime/ClassMethods.html +87 -121
- data/doc/Lazier/Exceptions.html +3 -3
- data/doc/Lazier/Exceptions/Dump.html +3 -3
- data/doc/Lazier/Hash.html +17 -19
- data/doc/Lazier/Math.html +3 -3
- data/doc/Lazier/Math/ClassMethods.html +14 -48
- data/doc/Lazier/Object.html +127 -139
- data/doc/Lazier/Pathname.html +11 -12
- data/doc/Lazier/Settings.html +189 -169
- data/doc/Lazier/String.html +23 -27
- data/doc/Lazier/TimeZone.html +202 -249
- data/doc/Lazier/TimeZone/ClassMethods.html +110 -137
- data/doc/Lazier/Version.html +7 -11
- data/doc/_index.html +4 -4
- data/doc/file.README.html +12 -9
- data/doc/frames.html +1 -1
- data/doc/index.html +12 -9
- data/doc/method_list.html +72 -24
- data/doc/top-level-namespace.html +3 -3
- data/lazier.gemspec +8 -8
- data/lib/lazier.rb +55 -59
- data/lib/lazier/datetime.rb +74 -88
- data/lib/lazier/math.rb +2 -18
- data/lib/lazier/object.rb +14 -13
- data/lib/lazier/settings.rb +8 -25
- data/lib/lazier/version.rb +2 -2
- data/spec/lazier/datetime_spec.rb +12 -20
- data/spec/lazier/hash_spec.rb +1 -1
- data/spec/lazier/object_spec.rb +3 -3
- data/spec/lazier/settings_spec.rb +3 -3
- data/spec/lazier_spec.rb +1 -19
- metadata +145 -160
data/doc/Lazier/Exceptions.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Exceptions
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -116,9 +116,9 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
|
-
0.8.
|
121
|
+
0.8.3 (ruby-1.9.3).
|
122
122
|
</div>
|
123
123
|
|
124
124
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Lazier::Exceptions::Dump
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -124,9 +124,9 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
|
-
0.8.
|
129
|
+
0.8.3 (ruby-1.9.3).
|
130
130
|
</div>
|
131
131
|
|
132
132
|
</body>
|
data/doc/Lazier/Hash.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Hash
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -278,20 +278,19 @@
|
|
278
278
|
<td>
|
279
279
|
<pre class="code"><span class="info file"># File 'lib/lazier/hash.rb', line 18</span>
|
280
280
|
|
281
|
-
<span class='
|
282
|
-
<span class='
|
281
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
282
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
283
283
|
|
284
|
-
<span class='
|
285
|
-
<span class='
|
286
|
-
<span class='
|
287
|
-
<span class='
|
288
|
-
<span class='
|
289
|
-
<span class='
|
290
|
-
<span class='
|
284
|
+
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
285
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
286
|
+
<span class='kw'>elsif</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
287
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span>
|
288
|
+
<span class='kw'>else</span>
|
289
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
290
|
+
<span class='kw'>end</span>
|
291
291
|
|
292
|
-
<span class='
|
293
|
-
<span class='
|
294
|
-
</pre>
|
292
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
293
|
+
<span class='kw'>end</span></pre>
|
295
294
|
</td>
|
296
295
|
</tr>
|
297
296
|
</table>
|
@@ -372,10 +371,9 @@
|
|
372
371
|
<td>
|
373
372
|
<pre class="code"><span class="info file"># File 'lib/lazier/hash.rb', line 36</span>
|
374
373
|
|
375
|
-
<span class='
|
376
|
-
<span class='lparen
|
377
|
-
<span class='
|
378
|
-
</pre>
|
374
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
375
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='op'>::</span><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
376
|
+
<span class='kw'>end</span></pre>
|
379
377
|
</td>
|
380
378
|
</tr>
|
381
379
|
</table>
|
@@ -386,9 +384,9 @@
|
|
386
384
|
</div>
|
387
385
|
|
388
386
|
<div id="footer">
|
389
|
-
Generated on
|
387
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
390
388
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
391
|
-
0.8.
|
389
|
+
0.8.3 (ruby-1.9.3).
|
392
390
|
</div>
|
393
391
|
|
394
392
|
</body>
|
data/doc/Lazier/Math.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Math
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -121,9 +121,9 @@
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on
|
124
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
|
-
0.8.
|
126
|
+
0.8.3 (ruby-1.9.3).
|
127
127
|
</div>
|
128
128
|
|
129
129
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Math::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -225,33 +225,16 @@
|
|
225
225
|
<pre class="lines">
|
226
226
|
|
227
227
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
37
|
232
|
-
38
|
233
|
-
39
|
234
|
-
40
|
235
|
-
41
|
236
|
-
42
|
237
|
-
43
|
238
|
-
44</pre>
|
228
|
+
26
|
229
|
+
27
|
230
|
+
28</pre>
|
239
231
|
</td>
|
240
232
|
<td>
|
241
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/math.rb', line
|
242
|
-
|
243
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_max identifier id'>max</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='rubyid_args identifier id'>args</span><span class='rparen token'>)</span>
|
244
|
-
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
|
245
|
-
|
246
|
-
<span class='rubyid_args identifier id'>args</span> <span class='assign token'>=</span> <span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_ensure_array identifier id'>ensure_array</span><span class='dot token'>.</span><span class='rubyid_flatten identifier id'>flatten</span>
|
247
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_length identifier id'>length</span> <span class='gt op'>></span> <span class='integer val'>0</span> <span class='rubyid_then then kw'>then</span>
|
248
|
-
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_args identifier id'>args</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
|
249
|
-
<span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_a identifier id'>a</span><span class='bitor op'>|</span> <span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_a identifier id'>a</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_a identifier id'>a</span> <span class='gt op'>></span> <span class='rubyid_rv identifier id'>rv</span> <span class='rubyid_end end kw'>end</span>
|
250
|
-
<span class='rubyid_end end kw'>end</span>
|
233
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/math.rb', line 26</span>
|
251
234
|
|
252
|
-
|
253
|
-
<span class='
|
254
|
-
</pre>
|
235
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_max'>max</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
236
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
|
237
|
+
<span class='kw'>end</span></pre>
|
255
238
|
</td>
|
256
239
|
</tr>
|
257
240
|
</table>
|
@@ -320,31 +303,14 @@
|
|
320
303
|
|
321
304
|
18
|
322
305
|
19
|
323
|
-
20
|
324
|
-
21
|
325
|
-
22
|
326
|
-
23
|
327
|
-
24
|
328
|
-
25
|
329
|
-
26
|
330
|
-
27
|
331
|
-
28</pre>
|
306
|
+
20</pre>
|
332
307
|
</td>
|
333
308
|
<td>
|
334
309
|
<pre class="code"><span class="info file"># File 'lib/lazier/math.rb', line 18</span>
|
335
310
|
|
336
|
-
<span class='
|
337
|
-
<span class='
|
338
|
-
|
339
|
-
<span class='rubyid_args identifier id'>args</span> <span class='assign token'>=</span> <span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_ensure_array identifier id'>ensure_array</span><span class='dot token'>.</span><span class='rubyid_flatten identifier id'>flatten</span>
|
340
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_length identifier id'>length</span> <span class='gt op'>></span> <span class='integer val'>0</span> <span class='rubyid_then then kw'>then</span>
|
341
|
-
<span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_args identifier id'>args</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
|
342
|
-
<span class='rubyid_args identifier id'>args</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_a identifier id'>a</span><span class='bitor op'>|</span> <span class='rubyid_rv identifier id'>rv</span> <span class='assign token'>=</span> <span class='rubyid_a identifier id'>a</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_a identifier id'>a</span> <span class='lt op'><</span> <span class='rubyid_rv identifier id'>rv</span> <span class='rubyid_end end kw'>end</span>
|
343
|
-
<span class='rubyid_end end kw'>end</span>
|
344
|
-
|
345
|
-
<span class='rubyid_rv identifier id'>rv</span>
|
346
|
-
<span class='rubyid_end end kw'>end</span>
|
347
|
-
</pre>
|
311
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_min'>min</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
312
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
313
|
+
<span class='kw'>end</span></pre>
|
348
314
|
</td>
|
349
315
|
</tr>
|
350
316
|
</table>
|
@@ -355,9 +321,9 @@
|
|
355
321
|
</div>
|
356
322
|
|
357
323
|
<div id="footer">
|
358
|
-
Generated on
|
324
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
359
325
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
360
|
-
0.8.
|
326
|
+
0.8.3 (ruby-1.9.3).
|
361
327
|
</div>
|
362
328
|
|
363
329
|
</body>
|
data/doc/Lazier/Object.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Object
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -530,7 +530,6 @@
|
|
530
530
|
<pre class="lines">
|
531
531
|
|
532
532
|
|
533
|
-
161
|
534
533
|
162
|
535
534
|
163
|
536
535
|
164
|
@@ -544,27 +543,27 @@
|
|
544
543
|
172
|
545
544
|
173
|
546
545
|
174
|
547
|
-
175
|
546
|
+
175
|
547
|
+
176</pre>
|
548
548
|
</td>
|
549
549
|
<td>
|
550
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line
|
551
|
-
|
552
|
-
<span class='
|
553
|
-
<span class='
|
554
|
-
|
555
|
-
<span class='
|
556
|
-
<span class='
|
557
|
-
<span class='
|
558
|
-
<span class='
|
559
|
-
<span class='
|
560
|
-
<span class='
|
561
|
-
<span class='
|
562
|
-
<span class='
|
563
|
-
<span class='
|
564
|
-
|
565
|
-
<span class='
|
566
|
-
<span class='
|
567
|
-
</pre>
|
550
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 162</span>
|
551
|
+
|
552
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_debug_dump'>debug_dump</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='symbol'>:yaml</span><span class='comma'>,</span> <span class='id identifier rubyid_must_raise'>must_raise</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
553
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
554
|
+
|
555
|
+
<span class='kw'>begin</span>
|
556
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_format'>format</span> <span class='op'>==</span> <span class='symbol'>:pretty_json</span> <span class='kw'>then</span>
|
557
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_pretty_generate'>pretty_generate</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
558
|
+
<span class='kw'>else</span>
|
559
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format'>format</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
560
|
+
<span class='kw'>end</span>
|
561
|
+
<span class='kw'>rescue</span>
|
562
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span>
|
563
|
+
<span class='kw'>end</span>
|
564
|
+
|
565
|
+
<span class='id identifier rubyid_must_raise'>must_raise</span> <span class='op'>?</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Lazier</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>Dump</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
566
|
+
<span class='kw'>end</span></pre>
|
568
567
|
</td>
|
569
568
|
</tr>
|
570
569
|
</table>
|
@@ -619,10 +618,9 @@
|
|
619
618
|
<td>
|
620
619
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 64</span>
|
621
620
|
|
622
|
-
<span class='
|
623
|
-
<span class='
|
624
|
-
<span class='
|
625
|
-
</pre>
|
621
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ensure_array'>ensure_array</span>
|
622
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
|
623
|
+
<span class='kw'>end</span></pre>
|
626
624
|
</td>
|
627
625
|
</tr>
|
628
626
|
</table>
|
@@ -681,14 +679,13 @@
|
|
681
679
|
<td>
|
682
680
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 71</span>
|
683
681
|
|
684
|
-
<span class='
|
685
|
-
<span class='
|
686
|
-
<span class='
|
687
|
-
<span class='
|
688
|
-
<span class='
|
689
|
-
<span class='
|
690
|
-
<span class='
|
691
|
-
</pre>
|
682
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
683
|
+
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>String</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
684
|
+
<span class='kw'>self</span>
|
685
|
+
<span class='kw'>else</span>
|
686
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
687
|
+
<span class='kw'>end</span>
|
688
|
+
<span class='kw'>end</span></pre>
|
692
689
|
</td>
|
693
690
|
</tr>
|
694
691
|
</table>
|
@@ -781,27 +778,26 @@
|
|
781
778
|
<pre class="lines">
|
782
779
|
|
783
780
|
|
784
|
-
147
|
785
781
|
148
|
786
782
|
149
|
787
783
|
150
|
788
784
|
151
|
789
785
|
152
|
790
786
|
153
|
791
|
-
154
|
787
|
+
154
|
788
|
+
155</pre>
|
792
789
|
</td>
|
793
790
|
<td>
|
794
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line
|
791
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 148</span>
|
795
792
|
|
796
|
-
<span class='
|
797
|
-
<span class='
|
798
|
-
<span class='
|
799
|
-
<span class='
|
800
|
-
<span class='rbrace
|
793
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_boolean'>format_boolean</span><span class='lparen'>(</span><span class='id identifier rubyid_true_name'>true_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_false_name'>false_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
794
|
+
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
795
|
+
<span class='kw'>true</span> <span class='op'>=></span> <span class='id identifier rubyid_true_name'>true_name</span> <span class='op'>||</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_boolean_names'>boolean_names</span><span class='lbracket'>[</span><span class='kw'>true</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
796
|
+
<span class='kw'>false</span> <span class='op'>=></span> <span class='id identifier rubyid_false_name'>false_name</span> <span class='op'>||</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_boolean_names'>boolean_names</span><span class='lbracket'>[</span><span class='kw'>false</span><span class='rbracket'>]</span>
|
797
|
+
<span class='rbrace'>}</span>
|
801
798
|
|
802
|
-
<span class='
|
803
|
-
<span class='
|
804
|
-
</pre>
|
799
|
+
<span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_boolean'>to_boolean</span><span class='rbracket'>]</span>
|
800
|
+
<span class='kw'>end</span></pre>
|
805
801
|
</td>
|
806
802
|
</tr>
|
807
803
|
</table>
|
@@ -928,6 +924,12 @@
|
|
928
924
|
<pre class="lines">
|
929
925
|
|
930
926
|
|
927
|
+
126
|
928
|
+
127
|
929
|
+
128
|
930
|
+
129
|
931
|
+
130
|
932
|
+
131
|
931
933
|
132
|
932
934
|
133
|
933
935
|
134
|
@@ -935,20 +937,27 @@
|
|
935
937
|
136
|
936
938
|
137
|
937
939
|
138
|
938
|
-
139
|
940
|
+
139
|
941
|
+
140</pre>
|
939
942
|
</td>
|
940
943
|
<td>
|
941
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line
|
942
|
-
|
943
|
-
<span class='
|
944
|
-
<span class='
|
945
|
-
<span class='
|
946
|
-
<span class='
|
947
|
-
<span class='
|
948
|
-
|
949
|
-
<span class='
|
950
|
-
|
951
|
-
</
|
944
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 126</span>
|
945
|
+
|
946
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format_number'>format_number</span><span class='lparen'>(</span><span class='id identifier rubyid_prec'>prec</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_decimal_separator'>decimal_separator</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_add_string'>add_string</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_k_separator'>k_separator</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
947
|
+
<span class='id identifier rubyid_prec'>prec</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_format_number'>format_number</span><span class='lbracket'>[</span><span class='symbol'>:prec</span><span class='rbracket'>]</span>
|
948
|
+
<span class='id identifier rubyid_decimal_separator'>decimal_separator</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_format_number'>format_number</span><span class='lbracket'>[</span><span class='symbol'>:decimal_separator</span><span class='rbracket'>]</span>
|
949
|
+
<span class='id identifier rubyid_add_string'>add_string</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_format_number'>format_number</span><span class='lbracket'>[</span><span class='symbol'>:add_string</span><span class='rbracket'>]</span>
|
950
|
+
<span class='id identifier rubyid_k_separator'>k_separator</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_format_number'>format_number</span><span class='lbracket'>[</span><span class='symbol'>:k_separator</span><span class='rbracket'>]</span>
|
951
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%n</span><span class='tstring_end'>"</span></span>
|
952
|
+
<span class='id identifier rubyid_unit'>unit</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
953
|
+
|
954
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_add_string'>add_string</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='kw'>then</span>
|
955
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%n %u</span><span class='tstring_end'>"</span></span>
|
956
|
+
<span class='id identifier rubyid_unit'>unit</span> <span class='op'>=</span> <span class='id identifier rubyid_add_string'>add_string</span>
|
957
|
+
<span class='kw'>end</span>
|
958
|
+
|
959
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_number?'>is_number?</span> <span class='op'>&&</span> <span class='id identifier rubyid_prec'>prec</span> <span class='op'>>=</span> <span class='int'>0</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_number_to_currency'>number_to_currency</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>precision:</span> <span class='id identifier rubyid_prec'>prec</span><span class='comma'>,</span> <span class='label'>separator:</span> <span class='id identifier rubyid_decimal_separator'>decimal_separator</span><span class='comma'>,</span> <span class='label'>delimiter:</span> <span class='id identifier rubyid_k_separator'>k_separator</span><span class='comma'>,</span> <span class='label'>format:</span> <span class='id identifier rubyid_format'>format</span><span class='comma'>,</span> <span class='label'>unit:</span> <span class='id identifier rubyid_unit'>unit</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
960
|
+
<span class='kw'>end</span></pre>
|
952
961
|
</td>
|
953
962
|
</tr>
|
954
963
|
</table>
|
@@ -1003,10 +1012,9 @@
|
|
1003
1012
|
<td>
|
1004
1013
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 57</span>
|
1005
1014
|
|
1006
|
-
<span class='
|
1007
|
-
<span class='
|
1008
|
-
<span class='
|
1009
|
-
</pre>
|
1015
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_boolean?'>is_boolean?</span>
|
1016
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>TrueClass</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>FalseClass</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>NilClass</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(1|0|true|false|yes|no|t|f|y|n)$</span><span class='regexp_end'>/i</span></span><span class='rparen'>)</span>
|
1017
|
+
<span class='kw'>end</span></pre>
|
1010
1018
|
</td>
|
1011
1019
|
</tr>
|
1012
1020
|
</table>
|
@@ -1061,10 +1069,9 @@
|
|
1061
1069
|
<td>
|
1062
1070
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 50</span>
|
1063
1071
|
|
1064
|
-
<span class='
|
1065
|
-
<span class='
|
1066
|
-
<span class='
|
1067
|
-
</pre>
|
1072
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_float?'>is_float?</span>
|
1073
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Float</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^([+-]?)(\d+)([.,]\d+)?$</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_number'>normalize_number</span><span class='rparen'>)</span>
|
1074
|
+
<span class='kw'>end</span></pre>
|
1068
1075
|
</td>
|
1069
1076
|
</tr>
|
1070
1077
|
</table>
|
@@ -1119,10 +1126,9 @@
|
|
1119
1126
|
<td>
|
1120
1127
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 43</span>
|
1121
1128
|
|
1122
|
-
<span class='
|
1123
|
-
<span class='
|
1124
|
-
<span class='
|
1125
|
-
</pre>
|
1129
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_integer?'>is_integer?</span>
|
1130
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^([+-]?)(\d+)$</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_number'>normalize_number</span><span class='rparen'>)</span>
|
1131
|
+
<span class='kw'>end</span></pre>
|
1126
1132
|
</td>
|
1127
1133
|
</tr>
|
1128
1134
|
</table>
|
@@ -1177,10 +1183,9 @@
|
|
1177
1183
|
<td>
|
1178
1184
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 36</span>
|
1179
1185
|
|
1180
|
-
<span class='
|
1181
|
-
<span class='
|
1182
|
-
<span class='
|
1183
|
-
</pre>
|
1186
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_number?'>is_number?</span>
|
1187
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_float?'>is_float?</span>
|
1188
|
+
<span class='kw'>end</span></pre>
|
1184
1189
|
</td>
|
1185
1190
|
</tr>
|
1186
1191
|
</table>
|
@@ -1248,23 +1253,22 @@
|
|
1248
1253
|
<td>
|
1249
1254
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 16</span>
|
1250
1255
|
|
1251
|
-
<span class='
|
1252
|
-
<span class='
|
1253
|
-
|
1254
|
-
<span class='
|
1255
|
-
<span class='
|
1256
|
-
<span class='
|
1257
|
-
<span class='
|
1258
|
-
<span class='
|
1259
|
-
<span class='
|
1260
|
-
<span class='
|
1261
|
-
<span class='
|
1262
|
-
<span class='
|
1263
|
-
<span class='
|
1264
|
-
|
1265
|
-
<span class='
|
1266
|
-
<span class='
|
1267
|
-
</pre>
|
1256
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_normalize_number'>normalize_number</span>
|
1257
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
1258
|
+
|
1259
|
+
<span class='kw'>if</span> <span class='kw'>self</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='kw'>then</span>
|
1260
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1</span><span class='tstring_end'>"</span></span>
|
1261
|
+
<span class='kw'>elsif</span> <span class='op'>!</span><span class='kw'>self</span> <span class='kw'>then</span>
|
1262
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0</span><span class='tstring_end'>"</span></span>
|
1263
|
+
<span class='kw'>else</span>
|
1264
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
1265
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[\.,]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
1266
|
+
<span class='id identifier rubyid_rv'>rv</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id identifier rubyid_rv'>rv</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>1</span>
|
1267
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1268
|
+
<span class='kw'>end</span>
|
1269
|
+
|
1270
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
1271
|
+
<span class='kw'>end</span></pre>
|
1268
1272
|
</td>
|
1269
1273
|
</tr>
|
1270
1274
|
</table>
|
@@ -1333,17 +1337,16 @@
|
|
1333
1337
|
<pre class="lines">
|
1334
1338
|
|
1335
1339
|
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1340
|
+
114
|
1341
|
+
115
|
1342
|
+
116</pre>
|
1339
1343
|
</td>
|
1340
1344
|
<td>
|
1341
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line
|
1345
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 114</span>
|
1342
1346
|
|
1343
|
-
<span class='
|
1344
|
-
<span class='lparen
|
1345
|
-
<span class='
|
1346
|
-
</pre>
|
1347
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_round_to_precision'>round_to_precision</span><span class='lparen'>(</span><span class='id identifier rubyid_prec'>prec</span> <span class='op'>=</span> <span class='int'>2</span><span class='rparen'>)</span>
|
1348
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_number?'>is_number?</span> <span class='op'>&&</span> <span class='id identifier rubyid_prec'>prec</span> <span class='op'>>=</span> <span class='int'>0</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_number_with_precision'>number_with_precision</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='label'>precision:</span> <span class='id identifier rubyid_prec'>prec</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
1349
|
+
<span class='kw'>end</span></pre>
|
1347
1350
|
</td>
|
1348
1351
|
</tr>
|
1349
1352
|
</table>
|
@@ -1391,21 +1394,20 @@
|
|
1391
1394
|
<pre class="lines">
|
1392
1395
|
|
1393
1396
|
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1397
|
+
104
|
1398
|
+
105
|
1399
|
+
106
|
1400
|
+
107
|
1401
|
+
108</pre>
|
1399
1402
|
</td>
|
1400
1403
|
<td>
|
1401
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line
|
1402
|
-
|
1403
|
-
<span class='
|
1404
|
-
<span class='
|
1405
|
-
<span class='
|
1406
|
-
<span class='lparen
|
1407
|
-
<span class='
|
1408
|
-
</pre>
|
1404
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 104</span>
|
1405
|
+
|
1406
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_boolean'>to_boolean</span>
|
1407
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span>
|
1408
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Float</span><span class='rparen'>)</span>
|
1409
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>TrueClass</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(1|on|true|yes|t|y)$</span><span class='regexp_end'>/i</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
1410
|
+
<span class='kw'>end</span></pre>
|
1409
1411
|
</td>
|
1410
1412
|
</tr>
|
1411
1413
|
</table>
|
@@ -1487,16 +1489,15 @@
|
|
1487
1489
|
<td>
|
1488
1490
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 83</span>
|
1489
1491
|
|
1490
|
-
<span class='
|
1491
|
-
<span class='
|
1492
|
-
<span class='
|
1493
|
-
<span class='
|
1494
|
-
<span class='
|
1495
|
-
<span class='
|
1496
|
-
<span class='
|
1497
|
-
<span class='
|
1498
|
-
<span class='
|
1499
|
-
</pre>
|
1492
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_float'>to_float</span><span class='lparen'>(</span><span class='id identifier rubyid_default_value'>default_value</span> <span class='op'>=</span> <span class='float'>0.0</span><span class='rparen'>)</span>
|
1493
|
+
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Float</span><span class='rparen'>)</span>
|
1494
|
+
<span class='kw'>self</span>
|
1495
|
+
<span class='kw'>elsif</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Integer</span><span class='rparen'>)</span>
|
1496
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span>
|
1497
|
+
<span class='kw'>else</span>
|
1498
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_float?'>is_float?</span> <span class='op'>?</span> <span class='op'>::</span><span class='const'>Kernel</span><span class='period'>.</span><span class='const'>Float</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_normalize_number'>normalize_number</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_default_value'>default_value</span>
|
1499
|
+
<span class='kw'>end</span>
|
1500
|
+
<span class='kw'>end</span></pre>
|
1500
1501
|
</td>
|
1501
1502
|
</tr>
|
1502
1503
|
</table>
|
@@ -1567,27 +1568,14 @@
|
|
1567
1568
|
|
1568
1569
|
97
|
1569
1570
|
98
|
1570
|
-
99
|
1571
|
-
100
|
1572
|
-
101
|
1573
|
-
102
|
1574
|
-
103
|
1575
|
-
104
|
1576
|
-
105</pre>
|
1571
|
+
99</pre>
|
1577
1572
|
</td>
|
1578
1573
|
<td>
|
1579
1574
|
<pre class="code"><span class="info file"># File 'lib/lazier/object.rb', line 97</span>
|
1580
1575
|
|
1581
|
-
<span class='
|
1582
|
-
<span class='
|
1583
|
-
|
1584
|
-
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_Float constant id'>Float</span><span class='rparen token'>)</span>
|
1585
|
-
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_to_i identifier id'>to_i</span>
|
1586
|
-
<span class='rubyid_else else kw'>else</span>
|
1587
|
-
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_is_integer? fid id'>is_integer?</span> <span class='integer val'>? </span><span class='colon2 op'>::</span><span class='rubyid_Kernel constant id'>Kernel</span><span class='dot token'>.</span><span class='rubyid_Integer constant id'>Integer</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_normalize_number identifier id'>normalize_number</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_default_value identifier id'>default_value</span>
|
1588
|
-
<span class='rubyid_end end kw'>end</span>
|
1589
|
-
<span class='rubyid_end end kw'>end</span>
|
1590
|
-
</pre>
|
1576
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_integer'>to_integer</span><span class='lparen'>(</span><span class='id identifier rubyid_default_value'>default_value</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
|
1577
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_float'>to_float</span><span class='lparen'>(</span><span class='id identifier rubyid_default_value'>default_value</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
1578
|
+
<span class='kw'>end</span></pre>
|
1591
1579
|
</td>
|
1592
1580
|
</tr>
|
1593
1581
|
</table>
|
@@ -1598,9 +1586,9 @@
|
|
1598
1586
|
</div>
|
1599
1587
|
|
1600
1588
|
<div id="footer">
|
1601
|
-
Generated on
|
1589
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
1602
1590
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1603
|
-
0.8.
|
1591
|
+
0.8.3 (ruby-1.9.3).
|
1604
1592
|
</div>
|
1605
1593
|
|
1606
1594
|
</body>
|