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/String.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::String
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -228,9 +228,9 @@
|
|
228
228
|
<div class="discussion">
|
229
229
|
<p>Removes accents from the string, normalizing to the normal letter.</p>
|
230
230
|
|
231
|
-
<pre class="code ruby"><code><span class='
|
232
|
-
<span class='comment
|
233
|
-
</code></pre>
|
231
|
+
<pre class="code ruby"><code><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>èòàù</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_remove_accents'>remove_accents</span>
|
232
|
+
<span class='comment'># => "eoau"
|
233
|
+
</span></code></pre>
|
234
234
|
|
235
235
|
|
236
236
|
</div>
|
@@ -270,12 +270,11 @@
|
|
270
270
|
<td>
|
271
271
|
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 20</span>
|
272
272
|
|
273
|
-
<span class='
|
274
|
-
<span class='
|
275
|
-
<span class='
|
276
|
-
<span class='rbrace
|
277
|
-
<span class='
|
278
|
-
</pre>
|
273
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_accents'>remove_accents</span>
|
274
|
+
<span class='id identifier rubyid_silence_warnings'>silence_warnings</span> <span class='lbrace'>{</span>
|
275
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mb_chars'>mb_chars</span><span class='period'>.</span><span class='id identifier rubyid_normalize'>normalize</span><span class='lparen'>(</span><span class='symbol'>:kd</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^\x00-\x7F]</span><span class='regexp_end'>/n</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
276
|
+
<span class='rbrace'>}</span>
|
277
|
+
<span class='kw'>end</span></pre>
|
279
278
|
</td>
|
280
279
|
</tr>
|
281
280
|
</table>
|
@@ -330,10 +329,9 @@
|
|
330
329
|
<td>
|
331
330
|
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 43</span>
|
332
331
|
|
333
|
-
<span class='
|
334
|
-
<span class='
|
335
|
-
<span class='
|
336
|
-
</pre>
|
332
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_replace_ampersands'>replace_ampersands</span>
|
333
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>&amp;(\S+);</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>&\\1;</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
334
|
+
<span class='kw'>end</span></pre>
|
337
335
|
</td>
|
338
336
|
</tr>
|
339
337
|
</table>
|
@@ -354,9 +352,9 @@
|
|
354
352
|
|
355
353
|
<p>The string is downcased and spaces are substituted with <code>-</code>.</p>
|
356
354
|
|
357
|
-
<pre class="code ruby"><code><span class='
|
358
|
-
<span class='comment
|
359
|
-
</code></pre>
|
355
|
+
<pre class="code ruby"><code><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ABC cde</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_untitleize'>untitleize</span>
|
356
|
+
<span class='comment'># => "abc-cde"
|
357
|
+
</span></code></pre>
|
360
358
|
|
361
359
|
|
362
360
|
</div>
|
@@ -394,10 +392,9 @@
|
|
394
392
|
<td>
|
395
393
|
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 36</span>
|
396
394
|
|
397
|
-
<span class='
|
398
|
-
<span class='
|
399
|
-
<span class='
|
400
|
-
</pre>
|
395
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_untitleize'>untitleize</span>
|
396
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
397
|
+
<span class='kw'>end</span></pre>
|
401
398
|
</td>
|
402
399
|
</tr>
|
403
400
|
</table>
|
@@ -452,10 +449,9 @@
|
|
452
449
|
<td>
|
453
450
|
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 50</span>
|
454
451
|
|
455
|
-
<span class='
|
456
|
-
<span class='
|
457
|
-
<span class='
|
458
|
-
</pre>
|
452
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
|
453
|
+
<span class='kw'>self</span>
|
454
|
+
<span class='kw'>end</span></pre>
|
459
455
|
</td>
|
460
456
|
</tr>
|
461
457
|
</table>
|
@@ -466,9 +462,9 @@
|
|
466
462
|
</div>
|
467
463
|
|
468
464
|
<div id="footer">
|
469
|
-
Generated on
|
465
|
+
Generated on Mon Jan 28 20:23:45 2013 by
|
470
466
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
471
|
-
0.8.
|
467
|
+
0.8.3 (ruby-1.9.3).
|
472
468
|
</div>
|
473
469
|
|
474
470
|
</body>
|
data/doc/Lazier/TimeZone.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::TimeZone
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -126,7 +126,7 @@
|
|
126
126
|
<li class="public ">
|
127
127
|
<span class="summary_signature">
|
128
128
|
|
129
|
-
<a href="#aliases-instance_method" title="#aliases (instance method)">- (Array) <strong>aliases</strong>
|
129
|
+
<a href="#aliases-instance_method" title="#aliases (instance method)">- (Array) <strong>aliases</strong> </a>
|
130
130
|
|
131
131
|
|
132
132
|
|
@@ -241,7 +241,7 @@
|
|
241
241
|
<li class="public ">
|
242
242
|
<span class="summary_signature">
|
243
243
|
|
244
|
-
<a href="#dst_offset-instance_method" title="#dst_offset (instance method)">- (Fixnum|Rational) <strong>dst_offset</strong>(rational = false, year = nil) </a>
|
244
|
+
<a href="#dst_offset-instance_method" title="#dst_offset (instance method)">- (Fixnum|Rational) <strong>dst_offset</strong>(rational = false, year = nil, method = :utc_total_offset) </a>
|
245
245
|
|
246
246
|
|
247
247
|
|
@@ -435,7 +435,7 @@
|
|
435
435
|
<div class="method_details first">
|
436
436
|
<h3 class="signature first" id="aliases-instance_method">
|
437
437
|
|
438
|
-
- (<tt>Array</tt>) <strong>aliases</strong>
|
438
|
+
- (<tt>Array</tt>) <strong>aliases</strong>
|
439
439
|
|
440
440
|
|
441
441
|
|
@@ -449,28 +449,7 @@
|
|
449
449
|
</div>
|
450
450
|
</div>
|
451
451
|
<div class="tags">
|
452
|
-
<p class="tag_title">Parameters:</p>
|
453
|
-
<ul class="param">
|
454
|
-
|
455
|
-
<li>
|
456
|
-
|
457
|
-
<span class='name'>dst_label</span>
|
458
|
-
|
459
|
-
|
460
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
461
|
-
|
462
|
-
|
463
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
464
|
-
|
465
|
-
|
466
|
-
—
|
467
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
468
|
-
</div>
|
469
|
-
|
470
|
-
</li>
|
471
452
|
|
472
|
-
</ul>
|
473
|
-
|
474
453
|
<p class="tag_title">Returns:</p>
|
475
454
|
<ul class="return">
|
476
455
|
|
@@ -505,49 +484,22 @@
|
|
505
484
|
395
|
506
485
|
396
|
507
486
|
397
|
508
|
-
398
|
509
|
-
399
|
510
|
-
400
|
511
|
-
401
|
512
|
-
402
|
513
|
-
403
|
514
|
-
404
|
515
|
-
405
|
516
|
-
406
|
517
|
-
407
|
518
|
-
408
|
519
|
-
409
|
520
|
-
410
|
521
|
-
411</pre>
|
487
|
+
398</pre>
|
522
488
|
</td>
|
523
489
|
<td>
|
524
490
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 388</span>
|
525
491
|
|
526
|
-
<span class='
|
527
|
-
<span class='
|
528
|
-
|
529
|
-
<span class='
|
530
|
-
|
531
|
-
|
532
|
-
<span class='
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_name identifier id'>name</span> <span class='eq op'>==</span> <span class='string val'>"International Date Line West"</span> <span class='orop op'>||</span> <span class='rubyid_name identifier id'>name</span> <span class='eq op'>==</span> <span class='string val'>"UTC"</span> <span class='orop op'>||</span> <span class='rubyid_name identifier id'>name</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"(US & Canada)"</span><span class='rparen token'>)</span>
|
538
|
-
<span class='rubyid_@aliases ivar id'>@aliases</span> <span class='lshft op'><<</span> <span class='rubyid_name identifier id'>name</span>
|
539
|
-
<span class='rubyid_else else kw'>else</span>
|
540
|
-
<span class='rubyid_@aliases ivar id'>@aliases</span> <span class='lshft op'><<</span> <span class='rubyid_reference identifier id'>reference</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/\/.*/</span><span class='comma token'>,</span> <span class='string val'>"/"</span> <span class='plus op'>+</span> <span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
|
541
|
-
<span class='rubyid_end end kw'>end</span>
|
542
|
-
<span class='rubyid_end end kw'>end</span>
|
543
|
-
<span class='rubyid_end end kw'>end</span>
|
544
|
-
|
545
|
-
<span class='rubyid_@aliases ivar id'>@aliases</span> <span class='assign token'>=</span> <span class='rubyid_@aliases ivar id'>@aliases</span><span class='dot token'>.</span><span class='rubyid_uniq identifier id'>uniq</span><span class='dot token'>.</span><span class='rubyid_compact identifier id'>compact</span><span class='dot token'>.</span><span class='rubyid_sort identifier id'>sort</span>
|
546
|
-
<span class='rubyid_end end kw'>end</span>
|
547
|
-
|
548
|
-
<span class='rubyid_@aliases ivar id'>@aliases</span>
|
549
|
-
<span class='rubyid_end end kw'>end</span>
|
550
|
-
</pre>
|
492
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_aliases'>aliases</span>
|
493
|
+
<span class='id identifier rubyid_reference'>reference</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='op'>::</span><span class='const'>MAPPING</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
494
|
+
|
495
|
+
<span class='ivar'>@aliases</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_reference'>reference</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='op'>::</span><span class='const'>MAPPING</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_zone'>zone</span><span class='op'>|</span>
|
496
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_zone'>zone</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='id identifier rubyid_reference'>reference</span> <span class='kw'>then</span>
|
497
|
+
<span class='lparen'>(</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>International Date Line West</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>UTC</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(US & Canada)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>:</span> <span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
498
|
+
<span class='kw'>else</span>
|
499
|
+
<span class='kw'>nil</span>
|
500
|
+
<span class='kw'>end</span>
|
501
|
+
<span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
502
|
+
<span class='kw'>end</span></pre>
|
551
503
|
</td>
|
552
504
|
</tr>
|
553
505
|
</table>
|
@@ -578,33 +530,32 @@
|
|
578
530
|
<pre class="lines">
|
579
531
|
|
580
532
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
533
|
+
415
|
534
|
+
416
|
535
|
+
417
|
536
|
+
418
|
537
|
+
419
|
538
|
+
420
|
539
|
+
421
|
540
|
+
422
|
541
|
+
423
|
542
|
+
424
|
543
|
+
425</pre>
|
592
544
|
</td>
|
593
545
|
<td>
|
594
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
546
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 415</span>
|
595
547
|
|
596
|
-
<span class='
|
597
|
-
<span class='
|
548
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_current_alias'>current_alias</span>
|
549
|
+
<span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_tzinfo'>tzinfo</span><span class='period'>.</span><span class='id identifier rubyid_identifier'>identifier</span>
|
598
550
|
|
599
|
-
<span class='
|
600
|
-
<span class='
|
601
|
-
<span class='
|
602
|
-
<span class='
|
551
|
+
<span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:alias</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
552
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span>
|
553
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:alias</span><span class='comma'>,</span> <span class='id identifier rubyid_a'>a</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_a'>a</span> <span class='op'>==</span> <span class='id identifier rubyid_identifier'>identifier</span>
|
554
|
+
<span class='kw'>end</span>
|
603
555
|
|
604
|
-
<span class='
|
605
|
-
<span class='
|
606
|
-
<span class='
|
607
|
-
</pre>
|
556
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
557
|
+
<span class='kw'>end</span>
|
558
|
+
<span class='kw'>end</span></pre>
|
608
559
|
</td>
|
609
560
|
</tr>
|
610
561
|
</table>
|
@@ -690,27 +641,26 @@
|
|
690
641
|
<pre class="lines">
|
691
642
|
|
692
643
|
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
644
|
+
405
|
645
|
+
406
|
646
|
+
407
|
647
|
+
408
|
648
|
+
409
|
649
|
+
410
|
650
|
+
411
|
651
|
+
412</pre>
|
701
652
|
</td>
|
702
653
|
<td>
|
703
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 405</span>
|
704
655
|
|
705
|
-
<span class='
|
706
|
-
<span class='
|
656
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_current_offset'>current_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rational'>rational</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
657
|
+
<span class='id identifier rubyid_date'>date</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
707
658
|
|
708
|
-
<span class='
|
659
|
+
<span class='id identifier rubyid_dst_period'>dst_period</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_period'>dst_period</span>
|
709
660
|
|
710
|
-
<span class='
|
711
|
-
<span class='
|
712
|
-
<span class='
|
713
|
-
</pre>
|
661
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_offset'>dst_offset</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span>
|
662
|
+
<span class='id identifier rubyid_rational'>rational</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
663
|
+
<span class='kw'>end</span></pre>
|
714
664
|
</td>
|
715
665
|
</tr>
|
716
666
|
</table>
|
@@ -796,21 +746,16 @@
|
|
796
746
|
<pre class="lines">
|
797
747
|
|
798
748
|
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
484
|
803
|
-
485</pre>
|
749
|
+
468
|
750
|
+
469
|
751
|
+
470</pre>
|
804
752
|
</td>
|
805
753
|
<td>
|
806
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
807
|
-
|
808
|
-
<span class='
|
809
|
-
<span class='
|
810
|
-
|
811
|
-
<span class='rubyid_rational identifier id'>rational</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_rationalize_offset identifier id'>rationalize_offset</span><span class='lparen token'>(</span><span class='rubyid_rv identifier id'>rv</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_rv identifier id'>rv</span>
|
812
|
-
<span class='rubyid_end end kw'>end</span>
|
813
|
-
</pre>
|
754
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 468</span>
|
755
|
+
|
756
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dst_correction'>dst_correction</span><span class='lparen'>(</span><span class='id identifier rubyid_rational'>rational</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
757
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_offset'>dst_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rational'>rational</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='symbol'>:std_offset</span><span class='rparen'>)</span>
|
758
|
+
<span class='kw'>end</span></pre>
|
814
759
|
</td>
|
815
760
|
</tr>
|
816
761
|
</table>
|
@@ -913,23 +858,22 @@
|
|
913
858
|
<pre class="lines">
|
914
859
|
|
915
860
|
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
861
|
+
490
|
862
|
+
491
|
863
|
+
492
|
864
|
+
493
|
865
|
+
494
|
866
|
+
495</pre>
|
922
867
|
</td>
|
923
868
|
<td>
|
924
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
869
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 490</span>
|
925
870
|
|
926
|
-
<span class='
|
927
|
-
<span class='
|
928
|
-
<span class='
|
871
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dst_name'>dst_name</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
872
|
+
<span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(DST)</span><span class='tstring_end'>"</span></span>
|
873
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
|
929
874
|
|
930
|
-
<span class='
|
931
|
-
<span class='
|
932
|
-
</pre>
|
875
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_uses_dst?'>uses_dst?</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='kw'>nil</span>
|
876
|
+
<span class='kw'>end</span></pre>
|
933
877
|
</td>
|
934
878
|
</tr>
|
935
879
|
</table>
|
@@ -938,7 +882,7 @@
|
|
938
882
|
<div class="method_details ">
|
939
883
|
<h3 class="signature " id="dst_offset-instance_method">
|
940
884
|
|
941
|
-
- (<tt>Fixnum|Rational</tt>) <strong>dst_offset</strong>(rational = false, year = nil)
|
885
|
+
- (<tt>Fixnum|Rational</tt>) <strong>dst_offset</strong>(rational = false, year = nil, method = :utc_total_offset)
|
942
886
|
|
943
887
|
|
944
888
|
|
@@ -989,6 +933,23 @@
|
|
989
933
|
|
990
934
|
</li>
|
991
935
|
|
936
|
+
<li>
|
937
|
+
|
938
|
+
<span class='name'>method</span>
|
939
|
+
|
940
|
+
|
941
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
942
|
+
|
943
|
+
|
944
|
+
<em class="default">(defaults to: <tt>:utc_total_offset</tt>)</em>
|
945
|
+
|
946
|
+
|
947
|
+
—
|
948
|
+
<div class='inline'><p>The method to use for getting the offset. Default is total offset from UTC.</p>
|
949
|
+
</div>
|
950
|
+
|
951
|
+
</li>
|
952
|
+
|
992
953
|
</ul>
|
993
954
|
|
994
955
|
<p class="tag_title">Returns:</p>
|
@@ -1015,21 +976,20 @@
|
|
1015
976
|
<pre class="lines">
|
1016
977
|
|
1017
978
|
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
979
|
+
478
|
980
|
+
479
|
981
|
+
480
|
982
|
+
481
|
983
|
+
482</pre>
|
1023
984
|
</td>
|
1024
985
|
<td>
|
1025
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1026
|
-
|
1027
|
-
<span class='
|
1028
|
-
<span class='
|
1029
|
-
<span class='
|
1030
|
-
<span class='
|
1031
|
-
<span class='
|
1032
|
-
</pre>
|
986
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 478</span>
|
987
|
+
|
988
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dst_offset'>dst_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rational'>rational</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='symbol'>:utc_total_offset</span><span class='rparen'>)</span>
|
989
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_period'>dst_period</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
|
990
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_period'>period</span> <span class='op'>?</span> <span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='int'>0</span>
|
991
|
+
<span class='id identifier rubyid_rational'>rational</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
992
|
+
<span class='kw'>end</span></pre>
|
1033
993
|
</td>
|
1034
994
|
</tr>
|
1035
995
|
</table>
|
@@ -1098,31 +1058,30 @@
|
|
1098
1058
|
<pre class="lines">
|
1099
1059
|
|
1100
1060
|
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1061
|
+
440
|
1062
|
+
441
|
1063
|
+
442
|
1064
|
+
443
|
1065
|
+
444
|
1066
|
+
445
|
1067
|
+
446
|
1068
|
+
447
|
1069
|
+
448
|
1070
|
+
449</pre>
|
1111
1071
|
</td>
|
1112
1072
|
<td>
|
1113
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1114
|
-
|
1115
|
-
<span class='
|
1116
|
-
<span class='
|
1117
|
-
|
1118
|
-
<span class='
|
1119
|
-
<span class='
|
1120
|
-
|
1121
|
-
<span class='
|
1122
|
-
<span class='
|
1123
|
-
<span class='
|
1124
|
-
<span class='
|
1125
|
-
</pre>
|
1073
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 440</span>
|
1074
|
+
|
1075
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dst_period'>dst_period</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1076
|
+
<span class='id identifier rubyid_year'>year</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_today'>today</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span>
|
1077
|
+
|
1078
|
+
<span class='id identifier rubyid_nothern_summer'>nothern_summer</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_civil'>civil</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='int'>7</span><span class='comma'>,</span> <span class='int'>15</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span> <span class='comment'># This is a representation of a summer period in the Northern Hemisphere.
|
1079
|
+
</span> <span class='id identifier rubyid_southern_summer'>southern_summer</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_civil'>civil</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>15</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span> <span class='comment'># This is a representation of a summer period in the Northern Hemisphere.
|
1080
|
+
</span>
|
1081
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</span><span class='id identifier rubyid_nothern_summer'>nothern_summer</span><span class='rparen'>)</span>
|
1082
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</span><span class='id identifier rubyid_southern_summer'>southern_summer</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span>
|
1083
|
+
<span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span> <span class='op'>?</span> <span class='id identifier rubyid_period'>period</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
1084
|
+
<span class='kw'>end</span></pre>
|
1126
1085
|
</td>
|
1127
1086
|
</tr>
|
1128
1087
|
</table>
|
@@ -1191,19 +1150,18 @@
|
|
1191
1150
|
<pre class="lines">
|
1192
1151
|
|
1193
1152
|
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1153
|
+
431
|
1154
|
+
432
|
1155
|
+
433
|
1156
|
+
434</pre>
|
1198
1157
|
</td>
|
1199
1158
|
<td>
|
1200
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1159
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 431</span>
|
1201
1160
|
|
1202
|
-
<span class='
|
1203
|
-
<span class='
|
1204
|
-
<span class='
|
1205
|
-
<span class='
|
1206
|
-
</pre>
|
1161
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rational'>rational</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
1162
|
+
<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_utc_offset'>utc_offset</span>
|
1163
|
+
<span class='id identifier rubyid_rational'>rational</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
1164
|
+
<span class='kw'>end</span></pre>
|
1207
1165
|
</td>
|
1208
1166
|
</tr>
|
1209
1167
|
</table>
|
@@ -1289,19 +1247,18 @@
|
|
1289
1247
|
<pre class="lines">
|
1290
1248
|
|
1291
1249
|
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1250
|
+
502
|
1251
|
+
503
|
1252
|
+
504
|
1253
|
+
505</pre>
|
1296
1254
|
</td>
|
1297
1255
|
<td>
|
1298
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1256
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 502</span>
|
1299
1257
|
|
1300
|
-
<span class='
|
1301
|
-
<span class='
|
1302
|
-
<span class='
|
1303
|
-
<span class='
|
1304
|
-
</pre>
|
1258
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_str'>to_str</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_colon'>colon</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
1259
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_current_alias'>current_alias</span>
|
1260
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(GMT</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_formatted_offset'>formatted_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_colon'>colon</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1261
|
+
<span class='kw'>end</span></pre>
|
1305
1262
|
</td>
|
1306
1263
|
</tr>
|
1307
1264
|
</table>
|
@@ -1387,17 +1344,16 @@
|
|
1387
1344
|
<pre class="lines">
|
1388
1345
|
|
1389
1346
|
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1347
|
+
531
|
1348
|
+
532
|
1349
|
+
533</pre>
|
1393
1350
|
</td>
|
1394
1351
|
<td>
|
1395
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1352
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 531</span>
|
1396
1353
|
|
1397
|
-
<span class='
|
1398
|
-
<span class='
|
1399
|
-
<span class='
|
1400
|
-
</pre>
|
1354
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_str_parameterized'>to_str_parameterized</span><span class='lparen'>(</span><span class='id identifier rubyid_with_offset'>with_offset</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1355
|
+
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='rparen'>)</span>
|
1356
|
+
<span class='kw'>end</span></pre>
|
1401
1357
|
</td>
|
1402
1358
|
</tr>
|
1403
1359
|
</table>
|
@@ -1500,35 +1456,34 @@
|
|
1500
1456
|
<pre class="lines">
|
1501
1457
|
|
1502
1458
|
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1459
|
+
513
|
1460
|
+
514
|
1461
|
+
515
|
1462
|
+
516
|
1463
|
+
517
|
1464
|
+
518
|
1465
|
+
519
|
1466
|
+
520
|
1467
|
+
521
|
1468
|
+
522
|
1469
|
+
523
|
1470
|
+
524</pre>
|
1515
1471
|
</td>
|
1516
1472
|
<td>
|
1517
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1518
|
-
|
1519
|
-
<span class='
|
1520
|
-
<span class='
|
1521
|
-
<span class='
|
1522
|
-
|
1523
|
-
<span class='
|
1524
|
-
<span class='
|
1525
|
-
<span class='
|
1526
|
-
<span class='
|
1527
|
-
<span class='
|
1528
|
-
<span class='
|
1529
|
-
<span class='
|
1530
|
-
<span class='
|
1531
|
-
</pre>
|
1473
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 513</span>
|
1474
|
+
|
1475
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_str_with_dst'>to_str_with_dst</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1476
|
+
<span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(DST)</span><span class='tstring_end'>"</span></span>
|
1477
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_current_alias'>current_alias</span>
|
1478
|
+
|
1479
|
+
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_uses_dst?'>uses_dst?</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
1480
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_period'>dst_period</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
|
1481
|
+
<span class='id identifier rubyid_offset'>offset</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_seconds_to_utc_offset'>seconds_to_utc_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_utc_total_offset'>utc_total_offset</span><span class='rparen'>)</span>
|
1482
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(GMT</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_offset'>offset</span><span class='rbrace'>}</span><span class='tstring_content'>) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1483
|
+
<span class='kw'>else</span>
|
1484
|
+
<span class='kw'>nil</span>
|
1485
|
+
<span class='kw'>end</span>
|
1486
|
+
<span class='kw'>end</span></pre>
|
1532
1487
|
</td>
|
1533
1488
|
</tr>
|
1534
1489
|
</table>
|
@@ -1648,19 +1603,18 @@
|
|
1648
1603
|
<pre class="lines">
|
1649
1604
|
|
1650
1605
|
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1606
|
+
542
|
1607
|
+
543
|
1608
|
+
544
|
1609
|
+
545</pre>
|
1655
1610
|
</td>
|
1656
1611
|
<td>
|
1657
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1612
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 542</span>
|
1658
1613
|
|
1659
|
-
<span class='
|
1660
|
-
<span class='
|
1661
|
-
<span class='
|
1662
|
-
<span class='
|
1663
|
-
</pre>
|
1614
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_str_with_dst_parameterized'>to_str_with_dst_parameterized</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1615
|
+
<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_to_str_with_dst'>to_str_with_dst</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
1616
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>?</span> <span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_rv'>rv</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
1617
|
+
<span class='kw'>end</span></pre>
|
1664
1618
|
</td>
|
1665
1619
|
</tr>
|
1666
1620
|
</table>
|
@@ -1729,25 +1683,24 @@
|
|
1729
1683
|
<pre class="lines">
|
1730
1684
|
|
1731
1685
|
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1686
|
+
455
|
1687
|
+
456
|
1688
|
+
457
|
1689
|
+
458
|
1690
|
+
459
|
1691
|
+
460
|
1692
|
+
461</pre>
|
1739
1693
|
</td>
|
1740
1694
|
<td>
|
1741
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
1742
|
-
|
1743
|
-
<span class='
|
1744
|
-
<span class='
|
1745
|
-
<span class='
|
1746
|
-
<span class='
|
1747
|
-
<span class='
|
1748
|
-
<span class='
|
1749
|
-
<span class='
|
1750
|
-
</pre>
|
1695
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 455</span>
|
1696
|
+
|
1697
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_uses_dst?'>uses_dst?</span><span class='lparen'>(</span><span class='id identifier rubyid_reference'>reference</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1698
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:year</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:utc</span><span class='rparen'>)</span> <span class='kw'>then</span> <span class='comment'># This is a date like object
|
1699
|
+
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_period'>dst_period</span><span class='lparen'>(</span><span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</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_period_for_utc'>period_for_utc</span><span class='lparen'>(</span><span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span>
|
1700
|
+
<span class='kw'>else</span>
|
1701
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dst_period'>dst_period</span><span class='lparen'>(</span><span class='id identifier rubyid_reference'>reference</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
1702
|
+
<span class='kw'>end</span>
|
1703
|
+
<span class='kw'>end</span></pre>
|
1751
1704
|
</td>
|
1752
1705
|
</tr>
|
1753
1706
|
</table>
|
@@ -1758,9 +1711,9 @@
|
|
1758
1711
|
</div>
|
1759
1712
|
|
1760
1713
|
<div id="footer">
|
1761
|
-
Generated on
|
1714
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
1762
1715
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1763
|
-
0.8.
|
1716
|
+
0.8.3 (ruby-1.9.3).
|
1764
1717
|
</div>
|
1765
1718
|
|
1766
1719
|
</body>
|