lazier 3.5.7 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis-gemfile +5 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +65 -8
- data/Gemfile +9 -8
- data/README.md +4 -0
- data/doc/Lazier.html +178 -110
- data/doc/Lazier/Boolean.html +7 -7
- data/doc/Lazier/Configuration.html +24 -50
- data/doc/Lazier/DateTime.html +50 -305
- data/doc/Lazier/DateTime/ClassMethods.html +116 -806
- data/doc/Lazier/Exceptions.html +2 -2
- data/doc/Lazier/Exceptions/Debug.html +1 -1
- data/doc/Lazier/Exceptions/MissingTranslation.html +18 -14
- data/doc/Lazier/Exceptions/TranslationExceptionHandler.html +213 -0
- data/doc/Lazier/Hash.html +19 -155
- data/doc/Lazier/I18n.html +1735 -230
- data/doc/Lazier/Math.html +1 -1
- data/doc/Lazier/Math/ClassMethods.html +13 -13
- data/doc/Lazier/Object.html +353 -339
- data/doc/Lazier/Pathname.html +4 -4
- data/doc/Lazier/Settings.html +150 -304
- data/doc/Lazier/String.html +39 -199
- data/doc/Lazier/TimeZone.html +244 -746
- data/doc/Lazier/TimeZone/ClassMethods.html +109 -127
- data/doc/Lazier/Version.html +4 -4
- data/doc/_index.html +15 -15
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +5 -1
- data/doc/index.html +5 -1
- data/doc/method_list.html +97 -169
- data/doc/top-level-namespace.html +1 -1
- data/lazier.gemspec +9 -6
- data/lib/lazier.rb +41 -50
- data/lib/lazier/boolean.rb +0 -1
- data/lib/lazier/configuration.rb +26 -28
- data/lib/lazier/datetime.rb +33 -127
- data/lib/lazier/exceptions.rb +14 -6
- data/lib/lazier/hash.rb +7 -15
- data/lib/lazier/i18n.rb +130 -48
- data/lib/lazier/math.rb +6 -7
- data/lib/lazier/object.rb +79 -97
- data/lib/lazier/pathname.rb +0 -1
- data/lib/lazier/settings.rb +12 -25
- data/lib/lazier/string.rb +17 -38
- data/lib/lazier/timezone.rb +168 -164
- data/lib/lazier/version.rb +3 -4
- data/locales/en.yml +52 -51
- data/locales/it.yml +51 -50
- data/spec/coverage_helper.rb +0 -1
- data/spec/lazier/boolean_spec.rb +2 -3
- data/spec/lazier/configuration_spec.rb +3 -5
- data/spec/lazier/datetime_spec.rb +34 -95
- data/spec/lazier/exceptions_spec.rb +25 -0
- data/spec/lazier/hash_spec.rb +0 -21
- data/spec/lazier/i18n_spec.rb +135 -51
- data/spec/lazier/math_spec.rb +0 -1
- data/spec/lazier/object_spec.rb +105 -100
- data/spec/lazier/pathname_spec.rb +0 -1
- data/spec/lazier/settings_spec.rb +25 -28
- data/spec/lazier/string_spec.rb +7 -20
- data/spec/lazier/timezone_spec.rb +101 -87
- data/spec/lazier_spec.rb +25 -8
- data/spec/spec_helper.rb +3 -2
- metadata +15 -44
- data/doc/Lazier/Localizer.html +0 -545
- data/lib/lazier/localizer.rb +0 -41
- data/spec/lazier/localizer_spec.rb +0 -45
data/doc/Lazier/String.html
CHANGED
@@ -162,30 +162,7 @@
|
|
162
162
|
<li class="public ">
|
163
163
|
<span class="summary_signature">
|
164
164
|
|
165
|
-
<a href="#
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
</span>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
<span class="summary_desc"><div class='inline'><p>Returns the string with all <code>&amp;</code> replaced with <code>&</code>.</p>
|
180
|
-
</div></span>
|
181
|
-
|
182
|
-
</li>
|
183
|
-
|
184
|
-
|
185
|
-
<li class="public ">
|
186
|
-
<span class="summary_signature">
|
187
|
-
|
188
|
-
<a href="#split_tokens-instance_method" title="#split_tokens (instance method)">- (Array) <strong>split_tokens</strong>(no_blanks = true, strip = true, uniq = false, pattern = /\s*,\s*/) </a>
|
165
|
+
<a href="#tokenize-instance_method" title="#tokenize (instance method)">- (Array) <strong>tokenize</strong>(no_blanks: true, strip: true, no_duplicates: false, pattern: /\s*,\s*/, presence_method: :present?) </a>
|
189
166
|
|
190
167
|
|
191
168
|
|
@@ -202,29 +179,6 @@
|
|
202
179
|
<span class="summary_desc"><div class='inline'><p>Splits a string containing tokens using a specified pattern and applying some sanitizations.</p>
|
203
180
|
</div></span>
|
204
181
|
|
205
|
-
</li>
|
206
|
-
|
207
|
-
|
208
|
-
<li class="public ">
|
209
|
-
<span class="summary_signature">
|
210
|
-
|
211
|
-
<a href="#untitleize-instance_method" title="#untitleize (instance method)">- (String) <strong>untitleize</strong> </a>
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
</span>
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
<span class="summary_desc"><div class='inline'><p>Returns the tagged version of a string.</p>
|
226
|
-
</div></span>
|
227
|
-
|
228
182
|
</li>
|
229
183
|
|
230
184
|
|
@@ -324,13 +278,13 @@
|
|
324
278
|
<pre class="lines">
|
325
279
|
|
326
280
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
281
|
+
15
|
282
|
+
16
|
283
|
+
17
|
284
|
+
18</pre>
|
331
285
|
</td>
|
332
286
|
<td>
|
333
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line
|
287
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 15</span>
|
334
288
|
|
335
289
|
<span class='kw'>def</span> <span class='id identifier rubyid_ensure_valid_utf8'>ensure_valid_utf8</span><span class='lparen'>(</span><span class='id identifier rubyid_replacement'>replacement</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
336
290
|
<span class='comment'># This odd line is because if need to specify a different encoding (without losing infos) to replace invalid bytes and then we go back to utf-8
|
@@ -388,72 +342,15 @@
|
|
388
342
|
<pre class="lines">
|
389
343
|
|
390
344
|
|
391
|
-
20
|
392
|
-
21
|
393
|
-
22</pre>
|
394
|
-
</td>
|
395
|
-
<td>
|
396
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 20</span>
|
397
|
-
|
398
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_remove_accents'>remove_accents</span>
|
399
|
-
<span class='id identifier rubyid_silence_warnings'>silence_warnings</span> <span class='lbrace'>{</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> <span class='rbrace'>}</span>
|
400
|
-
<span class='kw'>end</span></pre>
|
401
|
-
</td>
|
402
|
-
</tr>
|
403
|
-
</table>
|
404
|
-
</div>
|
405
|
-
|
406
|
-
<div class="method_details ">
|
407
|
-
<h3 class="signature " id="replace_ampersands-instance_method">
|
408
|
-
|
409
|
-
- (<tt><span class='object_link'><a href="" title="Lazier::String (module)">String</a></span></tt>) <strong>replace_ampersands</strong>
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
</h3><div class="docstring">
|
416
|
-
<div class="discussion">
|
417
|
-
<p>Returns the string with all <code>&amp;</code> replaced with <code>&</code>.</p>
|
418
|
-
|
419
|
-
|
420
|
-
</div>
|
421
|
-
</div>
|
422
|
-
<div class="tags">
|
423
|
-
|
424
|
-
<p class="tag_title">Returns:</p>
|
425
|
-
<ul class="return">
|
426
|
-
|
427
|
-
<li>
|
428
|
-
|
429
|
-
|
430
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Lazier::String (module)">String</a></span></tt>)</span>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
—
|
435
|
-
<div class='inline'><p>The string with all <code>&amp;</code> replaced with <code>&</code>.</p>
|
436
|
-
</div>
|
437
|
-
|
438
|
-
</li>
|
439
|
-
|
440
|
-
</ul>
|
441
|
-
|
442
|
-
</div><table class="source_code">
|
443
|
-
<tr>
|
444
|
-
<td>
|
445
|
-
<pre class="lines">
|
446
|
-
|
447
|
-
|
448
|
-
50
|
449
345
|
51
|
450
|
-
52
|
346
|
+
52
|
347
|
+
53</pre>
|
451
348
|
</td>
|
452
349
|
<td>
|
453
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line
|
350
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 51</span>
|
454
351
|
|
455
|
-
<span class='kw'>def</span> <span class='id identifier
|
456
|
-
<span class='
|
352
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove_accents'>remove_accents</span>
|
353
|
+
<span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_transliterate'>transliterate</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
457
354
|
<span class='kw'>end</span></pre>
|
458
355
|
</td>
|
459
356
|
</tr>
|
@@ -461,9 +358,9 @@
|
|
461
358
|
</div>
|
462
359
|
|
463
360
|
<div class="method_details ">
|
464
|
-
<h3 class="signature " id="
|
361
|
+
<h3 class="signature " id="tokenize-instance_method">
|
465
362
|
|
466
|
-
- (<tt>Array</tt>) <strong>
|
363
|
+
- (<tt>Array</tt>) <strong>tokenize</strong>(no_blanks: true, strip: true, no_duplicates: false, pattern: /\s*,\s*/, presence_method: :present?)
|
467
364
|
|
468
365
|
|
469
366
|
|
@@ -488,8 +385,6 @@
|
|
488
385
|
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
489
386
|
|
490
387
|
|
491
|
-
<em class="default">(defaults to: <tt>true</tt>)</em>
|
492
|
-
|
493
388
|
|
494
389
|
—
|
495
390
|
<div class='inline'><p>If filter out blank tokens.</p>
|
@@ -505,8 +400,6 @@
|
|
505
400
|
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
506
401
|
|
507
402
|
|
508
|
-
<em class="default">(defaults to: <tt>true</tt>)</em>
|
509
|
-
|
510
403
|
|
511
404
|
—
|
512
405
|
<div class='inline'><p>If strip single tokens.</p>
|
@@ -516,14 +409,12 @@
|
|
516
409
|
|
517
410
|
<li>
|
518
411
|
|
519
|
-
<span class='name'>
|
412
|
+
<span class='name'>no_duplicates</span>
|
520
413
|
|
521
414
|
|
522
415
|
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
523
416
|
|
524
417
|
|
525
|
-
<em class="default">(defaults to: <tt>false</tt>)</em>
|
526
|
-
|
527
418
|
|
528
419
|
—
|
529
420
|
<div class='inline'><p>If return uniques elements.</p>
|
@@ -539,8 +430,6 @@
|
|
539
430
|
<span class='type'>(<tt><span class='object_link'><a href="" title="Lazier::String (module)">String</a></span>|Regexp</tt>)</span>
|
540
431
|
|
541
432
|
|
542
|
-
<em class="default">(defaults to: <tt>/\s*,\s*/</tt>)</em>
|
543
|
-
|
544
433
|
|
545
434
|
—
|
546
435
|
<div class='inline'><p>The pattern to use.</p>
|
@@ -548,92 +437,35 @@
|
|
548
437
|
|
549
438
|
</li>
|
550
439
|
|
551
|
-
</ul>
|
552
|
-
|
553
|
-
<p class="tag_title">Returns:</p>
|
554
|
-
<ul class="return">
|
555
|
-
|
556
440
|
<li>
|
557
441
|
|
442
|
+
<span class='name'>presence_method</span>
|
558
443
|
|
559
|
-
|
444
|
+
|
445
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
560
446
|
|
561
447
|
|
562
448
|
|
563
449
|
—
|
564
|
-
<div class='inline'><p>
|
450
|
+
<div class='inline'><p>The method to use to check if a token is present or not.</p>
|
565
451
|
</div>
|
566
452
|
|
567
453
|
</li>
|
568
454
|
|
569
455
|
</ul>
|
570
456
|
|
571
|
-
</div><table class="source_code">
|
572
|
-
<tr>
|
573
|
-
<td>
|
574
|
-
<pre class="lines">
|
575
|
-
|
576
|
-
|
577
|
-
68
|
578
|
-
69
|
579
|
-
70
|
580
|
-
71
|
581
|
-
72
|
582
|
-
73
|
583
|
-
74</pre>
|
584
|
-
</td>
|
585
|
-
<td>
|
586
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 68</span>
|
587
|
-
|
588
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_split_tokens'>split_tokens</span><span class='lparen'>(</span><span class='id identifier rubyid_no_blanks'>no_blanks</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_strip'>strip</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_uniq'>uniq</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_pattern'>pattern</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s*,\s*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
589
|
-
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
|
590
|
-
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:strip</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_strip'>strip</span>
|
591
|
-
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_select!'>select!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:present?</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_no_blanks'>no_blanks</span>
|
592
|
-
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span> <span class='kw'>if</span> <span class='id identifier rubyid_uniq'>uniq</span>
|
593
|
-
<span class='id identifier rubyid_rv'>rv</span>
|
594
|
-
<span class='kw'>end</span></pre>
|
595
|
-
</td>
|
596
|
-
</tr>
|
597
|
-
</table>
|
598
|
-
</div>
|
599
|
-
|
600
|
-
<div class="method_details ">
|
601
|
-
<h3 class="signature " id="untitleize-instance_method">
|
602
|
-
|
603
|
-
- (<tt><span class='object_link'><a href="" title="Lazier::String (module)">String</a></span></tt>) <strong>untitleize</strong>
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
</h3><div class="docstring">
|
610
|
-
<div class="discussion">
|
611
|
-
<p>Returns the tagged version of a string.</p>
|
612
|
-
|
613
|
-
<p>The string is downcased and spaces are substituted with <code>-</code>.</p>
|
614
|
-
|
615
|
-
<p><code>ruby
|
616
|
-
"ABC cde".untitleize
|
617
|
-
# => "abc-cde"
|
618
|
-
</code></p>
|
619
|
-
|
620
|
-
|
621
|
-
</div>
|
622
|
-
</div>
|
623
|
-
<div class="tags">
|
624
|
-
|
625
457
|
<p class="tag_title">Returns:</p>
|
626
458
|
<ul class="return">
|
627
459
|
|
628
460
|
<li>
|
629
461
|
|
630
462
|
|
631
|
-
<span class='type'>(<tt
|
463
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
632
464
|
|
633
465
|
|
634
466
|
|
635
467
|
—
|
636
|
-
<div class='inline'><p>
|
468
|
+
<div class='inline'><p>An array of tokens.</p>
|
637
469
|
</div>
|
638
470
|
|
639
471
|
</li>
|
@@ -646,15 +478,23 @@
|
|
646
478
|
<pre class="lines">
|
647
479
|
|
648
480
|
|
649
|
-
|
650
|
-
|
651
|
-
|
481
|
+
35
|
482
|
+
36
|
483
|
+
37
|
484
|
+
38
|
485
|
+
39
|
486
|
+
40
|
487
|
+
41</pre>
|
652
488
|
</td>
|
653
489
|
<td>
|
654
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line
|
490
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 35</span>
|
655
491
|
|
656
|
-
<span class='kw'>def</span> <span class='id identifier
|
657
|
-
<span class='id identifier
|
492
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_tokenize'>tokenize</span><span class='lparen'>(</span><span class='label'>no_blanks:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>strip:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>no_duplicates:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>pattern:</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s*,\s*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='label'>presence_method:</span> <span class='symbol'>:present?</span><span class='rparen'>)</span>
|
493
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
|
494
|
+
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:strip</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_strip'>strip</span>
|
495
|
+
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_select!'>select!</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_presence_method'>presence_method</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_no_blanks'>no_blanks</span>
|
496
|
+
<span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span> <span class='kw'>if</span> <span class='id identifier rubyid_no_duplicates'>no_duplicates</span>
|
497
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
658
498
|
<span class='kw'>end</span></pre>
|
659
499
|
</td>
|
660
500
|
</tr>
|
@@ -703,12 +543,12 @@
|
|
703
543
|
<pre class="lines">
|
704
544
|
|
705
545
|
|
706
|
-
|
707
|
-
|
708
|
-
|
546
|
+
23
|
547
|
+
24
|
548
|
+
25</pre>
|
709
549
|
</td>
|
710
550
|
<td>
|
711
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line
|
551
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/string.rb', line 23</span>
|
712
552
|
|
713
553
|
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
|
714
554
|
<span class='kw'>self</span>
|
@@ -723,7 +563,7 @@
|
|
723
563
|
</div>
|
724
564
|
|
725
565
|
<div id="footer">
|
726
|
-
Generated on
|
566
|
+
Generated on Sun Jun 1 15:50:05 2014 by
|
727
567
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
728
568
|
0.8.7.4 (ruby-2.1.2).
|
729
569
|
</div>
|
data/doc/Lazier/TimeZone.html
CHANGED
@@ -109,6 +109,50 @@
|
|
109
109
|
|
110
110
|
</p>
|
111
111
|
|
112
|
+
<h2>Constant Summary</h2>
|
113
|
+
|
114
|
+
<dl class="constants">
|
115
|
+
|
116
|
+
<dt id="ALREADY_PARAMETERIZED-constant" class="">ALREADY_PARAMETERIZED =
|
117
|
+
<div class="docstring">
|
118
|
+
<div class="discussion">
|
119
|
+
<p>Pattern for a parameterized timezone.</p>
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<div class="tags">
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
</dt>
|
129
|
+
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^[+-]\d{4}@[a-z-]+</span><span class='regexp_end'>/</span></span></pre></dd>
|
130
|
+
|
131
|
+
<dt id="PARAMETERIZER-constant" class="">PARAMETERIZER =
|
132
|
+
<div class="docstring">
|
133
|
+
<div class="discussion">
|
134
|
+
<p>Pattern for a unparameterized timezone.</p>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<div class="tags">
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
</dt>
|
144
|
+
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(
|
145
|
+
\(
|
146
|
+
[a-z]+ # UTC Label
|
147
|
+
(?<offset>([+-])(\d{2})(:?)(\d{2}))
|
148
|
+
\)
|
149
|
+
\s
|
150
|
+
(?<label>.+)
|
151
|
+
)$</span><span class='regexp_end'>/xi</span></span></pre></dd>
|
152
|
+
|
153
|
+
</dl>
|
154
|
+
|
155
|
+
|
112
156
|
|
113
157
|
|
114
158
|
|
@@ -172,7 +216,7 @@
|
|
172
216
|
<li class="public ">
|
173
217
|
<span class="summary_signature">
|
174
218
|
|
175
|
-
<a href="#
|
219
|
+
<a href="#current_name-instance_method" title="#current_name (instance method)">- (String) <strong>current_name</strong>(dst = false, dst_label: " (DST)", year: nil) </a>
|
176
220
|
|
177
221
|
|
178
222
|
|
@@ -186,7 +230,7 @@
|
|
186
230
|
|
187
231
|
|
188
232
|
|
189
|
-
<span class="summary_desc"><div class='inline'><p>
|
233
|
+
<span class="summary_desc"><div class='inline'><p>Returns the current name.</p>
|
190
234
|
</div></span>
|
191
235
|
|
192
236
|
</li>
|
@@ -235,52 +279,6 @@
|
|
235
279
|
<span class="summary_desc"><div class='inline'><p>Return the correction applied to the standard offset the timezone when the Daylight Saving Time (DST) is active.</p>
|
236
280
|
</div></span>
|
237
281
|
|
238
|
-
</li>
|
239
|
-
|
240
|
-
|
241
|
-
<li class="public ">
|
242
|
-
<span class="summary_signature">
|
243
|
-
|
244
|
-
<a href="#dst_name-instance_method" title="#dst_name (instance method)">- (String) <strong>dst_name</strong>(dst_label = nil, year = nil, name = nil) </a>
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
</span>
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
<span class="summary_desc"><div class='inline'><p>Returns the name for this zone with Daylight Saving Time (DST) active.</p>
|
259
|
-
</div></span>
|
260
|
-
|
261
|
-
</li>
|
262
|
-
|
263
|
-
|
264
|
-
<li class="public ">
|
265
|
-
<span class="summary_signature">
|
266
|
-
|
267
|
-
<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>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
</span>
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
<span class="summary_desc"><div class='inline'><p>Returns the standard offset for this timezone timezone when the Daylight Saving Time (DST) is active.</p>
|
282
|
-
</div></span>
|
283
|
-
|
284
282
|
</li>
|
285
283
|
|
286
284
|
|
@@ -310,7 +308,7 @@
|
|
310
308
|
<li class="public ">
|
311
309
|
<span class="summary_signature">
|
312
310
|
|
313
|
-
<a href="#offset-instance_method" title="#offset (instance method)">- (Fixnum|Rational) <strong>offset</strong>(rational
|
311
|
+
<a href="#offset-instance_method" title="#offset (instance method)">- (Fixnum|Rational) <strong>offset</strong>(rational: false, dst: false, year: nil) </a>
|
314
312
|
|
315
313
|
|
316
314
|
|
@@ -333,76 +331,7 @@
|
|
333
331
|
<li class="public ">
|
334
332
|
<span class="summary_signature">
|
335
333
|
|
336
|
-
<a href="#to_str-instance_method" title="#to_str (instance method)">- (String) <strong>to_str</strong>(
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
</span>
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
<span class="summary_desc"><div class='inline'><p>Returns the name for this zone with Daylight Saving Time (DST) active.</p>
|
351
|
-
</div></span>
|
352
|
-
|
353
|
-
</li>
|
354
|
-
|
355
|
-
|
356
|
-
<li class="public ">
|
357
|
-
<span class="summary_signature">
|
358
|
-
|
359
|
-
<a href="#to_str_parameterized-instance_method" title="#to_str_parameterized (instance method)">- (String) <strong>to_str_parameterized</strong>(with_offset = true, name = nil) </a>
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
</span>
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
<span class="summary_desc"><div class='inline'><p>Returns a parameterized string representation for this zone.</p>
|
374
|
-
</div></span>
|
375
|
-
|
376
|
-
</li>
|
377
|
-
|
378
|
-
|
379
|
-
<li class="public ">
|
380
|
-
<span class="summary_signature">
|
381
|
-
|
382
|
-
<a href="#to_str_with_dst-instance_method" title="#to_str_with_dst (instance method)">- (String) <strong>to_str_with_dst</strong>(dst_label = nil, year = nil, name = nil) </a>
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
</span>
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
<span class="summary_desc"><div class='inline'><p>Returns a string representation for this zone with Daylight Saving Time (DST) active.</p>
|
397
|
-
</div></span>
|
398
|
-
|
399
|
-
</li>
|
400
|
-
|
401
|
-
|
402
|
-
<li class="public ">
|
403
|
-
<span class="summary_signature">
|
404
|
-
|
405
|
-
<a href="#to_str_with_dst_parameterized-instance_method" title="#to_str_with_dst_parameterized (instance method)">- (String) <strong>to_str_with_dst_parameterized</strong>(dst_label = nil, year = nil, name = nil) </a>
|
334
|
+
<a href="#to_str-instance_method" title="#to_str (instance method)">- (String) <strong>to_str</strong>(dst = false, **args) </a>
|
406
335
|
|
407
336
|
|
408
337
|
|
@@ -416,7 +345,7 @@
|
|
416
345
|
|
417
346
|
|
418
347
|
|
419
|
-
<span class="summary_desc"><div class='inline'><p>
|
348
|
+
<span class="summary_desc"><div class='inline'><p>Formats this zone as a string.</p>
|
420
349
|
</div></span>
|
421
350
|
|
422
351
|
</li>
|
@@ -497,13 +426,13 @@
|
|
497
426
|
<pre class="lines">
|
498
427
|
|
499
428
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
429
|
+
153
|
430
|
+
154
|
431
|
+
155
|
432
|
+
156</pre>
|
504
433
|
</td>
|
505
434
|
<td>
|
506
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
435
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 153</span>
|
507
436
|
|
508
437
|
<span class='kw'>def</span> <span class='id identifier rubyid_aliases'>aliases</span>
|
509
438
|
<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='id identifier rubyid_name'>name</span><span class='comma'>,</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>
|
@@ -556,8 +485,6 @@
|
|
556
485
|
<pre class="lines">
|
557
486
|
|
558
487
|
|
559
|
-
169
|
560
|
-
170
|
561
488
|
171
|
562
489
|
172
|
563
490
|
173
|
@@ -568,26 +495,20 @@
|
|
568
495
|
178
|
569
496
|
179
|
570
497
|
180
|
571
|
-
181
|
572
|
-
182
|
573
|
-
183</pre>
|
498
|
+
181</pre>
|
574
499
|
</td>
|
575
500
|
<td>
|
576
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
501
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 171</span>
|
577
502
|
|
578
503
|
<span class='kw'>def</span> <span class='id identifier rubyid_current_alias'>current_alias</span>
|
579
|
-
<span class='
|
580
|
-
<span class='ivar'>@current_alias</span>
|
581
|
-
<span class='kw'>else</span>
|
582
|
-
<span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='id identifier rubyid_tzinfo'>tzinfo</span><span class='period'>.</span><span class='id identifier rubyid_identifier'>identifier</span>
|
504
|
+
<span class='id identifier rubyid_identifier'>identifier</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
583
505
|
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
<span class='kw'>end</span>
|
588
|
-
|
589
|
-
<span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
506
|
+
<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>
|
507
|
+
<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>
|
508
|
+
<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>
|
590
509
|
<span class='kw'>end</span>
|
510
|
+
|
511
|
+
<span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
591
512
|
<span class='kw'>end</span>
|
592
513
|
<span class='kw'>end</span></pre>
|
593
514
|
</td>
|
@@ -596,9 +517,9 @@
|
|
596
517
|
</div>
|
597
518
|
|
598
519
|
<div class="method_details ">
|
599
|
-
<h3 class="signature " id="
|
520
|
+
<h3 class="signature " id="current_name-instance_method">
|
600
521
|
|
601
|
-
- (<tt><span class='object_link'><a href="
|
522
|
+
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>current_name</strong>(dst = false, dst_label: " (DST)", year: nil)
|
602
523
|
|
603
524
|
|
604
525
|
|
@@ -606,7 +527,7 @@
|
|
606
527
|
|
607
528
|
</h3><div class="docstring">
|
608
529
|
<div class="discussion">
|
609
|
-
<p>
|
530
|
+
<p>Returns the current name.</p>
|
610
531
|
|
611
532
|
|
612
533
|
</div>
|
@@ -617,7 +538,24 @@
|
|
617
538
|
|
618
539
|
<li>
|
619
540
|
|
620
|
-
<span class='name'>
|
541
|
+
<span class='name'>dst</span>
|
542
|
+
|
543
|
+
|
544
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
545
|
+
|
546
|
+
|
547
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
548
|
+
|
549
|
+
|
550
|
+
—
|
551
|
+
<div class='inline'><p>If to return the name with DST indication.</p>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</li>
|
555
|
+
|
556
|
+
<li>
|
557
|
+
|
558
|
+
<span class='name'>dst_label</span>
|
621
559
|
|
622
560
|
|
623
561
|
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
@@ -625,13 +563,45 @@
|
|
625
563
|
|
626
564
|
|
627
565
|
—
|
628
|
-
<div class='inline'><p>
|
566
|
+
<div class='inline'><p>Label for the DST indication. Defaults to ` (DST)`.</p>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
</li>
|
570
|
+
|
571
|
+
<li>
|
572
|
+
|
573
|
+
<span class='name'>year</span>
|
574
|
+
|
575
|
+
|
576
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
—
|
581
|
+
<div class='inline'><p>The year to which refer to. Defaults to the current year. <em>Only required when <code>dst</code> is true</em>.</p>
|
629
582
|
</div>
|
630
583
|
|
631
584
|
</li>
|
632
585
|
|
633
586
|
</ul>
|
634
587
|
|
588
|
+
<p class="tag_title">Returns:</p>
|
589
|
+
<ul class="return">
|
590
|
+
|
591
|
+
<li>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'><p>The name for the zone.</p>
|
600
|
+
</div>
|
601
|
+
|
602
|
+
</li>
|
603
|
+
|
604
|
+
</ul>
|
635
605
|
|
636
606
|
</div><table class="source_code">
|
637
607
|
<tr>
|
@@ -639,15 +609,21 @@
|
|
639
609
|
<pre class="lines">
|
640
610
|
|
641
611
|
|
642
|
-
188
|
643
612
|
189
|
644
|
-
190
|
613
|
+
190
|
614
|
+
191
|
615
|
+
192
|
616
|
+
193
|
617
|
+
194</pre>
|
645
618
|
</td>
|
646
619
|
<td>
|
647
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
620
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 189</span>
|
648
621
|
|
649
|
-
<span class='kw'>def</span> <span class='id identifier
|
650
|
-
<span class='
|
622
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_current_name'>current_name</span><span class='lparen'>(</span><span class='id identifier rubyid_dst'>dst</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>dst_label:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> (DST)</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>year:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
623
|
+
<span class='id identifier rubyid_year'>year</span> <span class='op'>||=</span> <span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span>
|
624
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_current_alias'>current_alias</span>
|
625
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>+=</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='kw'>if</span> <span class='id identifier rubyid_dst'>dst</span> <span class='op'>&&</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>
|
626
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
651
627
|
<span class='kw'>end</span></pre>
|
652
628
|
</td>
|
653
629
|
</tr>
|
@@ -734,19 +710,17 @@
|
|
734
710
|
<pre class="lines">
|
735
711
|
|
736
712
|
|
737
|
-
160
|
738
|
-
161
|
739
|
-
162
|
740
713
|
163
|
741
|
-
164
|
714
|
+
164
|
715
|
+
165
|
716
|
+
166</pre>
|
742
717
|
</td>
|
743
718
|
<td>
|
744
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
719
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 163</span>
|
745
720
|
|
746
721
|
<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>
|
747
|
-
<span class='id identifier rubyid_date'>date</span> <span class='op'
|
748
|
-
<span class='id identifier
|
749
|
-
<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>
|
722
|
+
<span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='lparen'>(</span><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_current'>current</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_time_zone'>in_time_zone</span>
|
723
|
+
<span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='label'>rational:</span> <span class='id identifier rubyid_rational'>rational</span><span class='comma'>,</span> <span class='label'>dst:</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span><span class='comma'>,</span> <span class='label'>year:</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
|
750
724
|
<span class='kw'>end</span></pre>
|
751
725
|
</td>
|
752
726
|
</tr>
|
@@ -833,15 +807,17 @@
|
|
833
807
|
<pre class="lines">
|
834
808
|
|
835
809
|
|
836
|
-
|
837
|
-
|
838
|
-
|
810
|
+
245
|
811
|
+
246
|
812
|
+
247
|
813
|
+
248</pre>
|
839
814
|
</td>
|
840
815
|
<td>
|
841
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
816
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 245</span>
|
842
817
|
|
843
818
|
<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>
|
844
|
-
<span class='id identifier
|
819
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_dst_offset'>dst_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='symbol'>:std_offset</span><span class='rparen'>)</span>
|
820
|
+
<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>
|
845
821
|
<span class='kw'>end</span></pre>
|
846
822
|
</td>
|
847
823
|
</tr>
|
@@ -849,9 +825,9 @@
|
|
849
825
|
</div>
|
850
826
|
|
851
827
|
<div class="method_details ">
|
852
|
-
<h3 class="signature " id="
|
828
|
+
<h3 class="signature " id="dst_period-instance_method">
|
853
829
|
|
854
|
-
- (<tt
|
830
|
+
- (<tt>TimezonePeriod</tt>) <strong>dst_period</strong>(year = nil)
|
855
831
|
|
856
832
|
|
857
833
|
|
@@ -859,7 +835,7 @@
|
|
859
835
|
|
860
836
|
</h3><div class="docstring">
|
861
837
|
<div class="discussion">
|
862
|
-
<p>
|
838
|
+
<p>Gets a period for this timezone when the Daylight Saving Time (DST) is active (it takes care of different hemispheres).</p>
|
863
839
|
|
864
840
|
|
865
841
|
</div>
|
@@ -868,23 +844,6 @@
|
|
868
844
|
<p class="tag_title">Parameters:</p>
|
869
845
|
<ul class="param">
|
870
846
|
|
871
|
-
<li>
|
872
|
-
|
873
|
-
<span class='name'>dst_label</span>
|
874
|
-
|
875
|
-
|
876
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
877
|
-
|
878
|
-
|
879
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
880
|
-
|
881
|
-
|
882
|
-
—
|
883
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
884
|
-
</div>
|
885
|
-
|
886
|
-
</li>
|
887
|
-
|
888
847
|
<li>
|
889
848
|
|
890
849
|
<span class='name'>year</span>
|
@@ -902,23 +861,6 @@
|
|
902
861
|
|
903
862
|
</li>
|
904
863
|
|
905
|
-
<li>
|
906
|
-
|
907
|
-
<span class='name'>name</span>
|
908
|
-
|
909
|
-
|
910
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
911
|
-
|
912
|
-
|
913
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
914
|
-
|
915
|
-
|
916
|
-
—
|
917
|
-
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
918
|
-
</div>
|
919
|
-
|
920
|
-
</li>
|
921
|
-
|
922
864
|
</ul>
|
923
865
|
|
924
866
|
<p class="tag_title">Returns:</p>
|
@@ -927,12 +869,12 @@
|
|
927
869
|
<li>
|
928
870
|
|
929
871
|
|
930
|
-
<span class='type'>(<tt
|
872
|
+
<span class='type'>(<tt>TimezonePeriod</tt>)</span>
|
931
873
|
|
932
874
|
|
933
875
|
|
934
876
|
—
|
935
|
-
<div class='inline'><p>
|
877
|
+
<div class='inline'><p>A period when the Daylight Saving Time (DST) is active or <code>nil</code> if the timezone doesn’t use DST for that year.</p>
|
936
878
|
</div>
|
937
879
|
|
938
880
|
</li>
|
@@ -945,15 +887,27 @@
|
|
945
887
|
<pre class="lines">
|
946
888
|
|
947
889
|
|
948
|
-
|
949
|
-
|
950
|
-
|
890
|
+
230
|
891
|
+
231
|
892
|
+
232
|
893
|
+
233
|
894
|
+
234
|
895
|
+
235
|
896
|
+
236
|
897
|
+
237
|
898
|
+
238</pre>
|
951
899
|
</td>
|
952
900
|
<td>
|
953
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
901
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 230</span>
|
902
|
+
|
903
|
+
<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>
|
904
|
+
<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_current'>current</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span>
|
954
905
|
|
955
|
-
<span class='
|
956
|
-
<span class='id identifier
|
906
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</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='comma'>,</span> <span class='int'>12</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='rparen'>)</span> <span class='comment'># Summer for the northern hemisphere
|
907
|
+
</span> <span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</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='comma'>,</span> <span class='int'>12</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span> <span class='comment'># Summer for the southern hemisphere
|
908
|
+
</span> <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>
|
909
|
+
<span class='kw'>rescue</span>
|
910
|
+
<span class='kw'>nil</span>
|
957
911
|
<span class='kw'>end</span></pre>
|
958
912
|
</td>
|
959
913
|
</tr>
|
@@ -961,9 +915,9 @@
|
|
961
915
|
</div>
|
962
916
|
|
963
917
|
<div class="method_details ">
|
964
|
-
<h3 class="signature " id="
|
918
|
+
<h3 class="signature " id="offset-instance_method">
|
965
919
|
|
966
|
-
- (<tt>Fixnum|Rational</tt>) <strong>
|
920
|
+
- (<tt>Fixnum|Rational</tt>) <strong>offset</strong>(rational: false, dst: false, year: nil)
|
967
921
|
|
968
922
|
|
969
923
|
|
@@ -971,7 +925,7 @@
|
|
971
925
|
|
972
926
|
</h3><div class="docstring">
|
973
927
|
<div class="discussion">
|
974
|
-
<p>Returns the standard offset for this timezone
|
928
|
+
<p>Returns the standard offset for this timezone.</p>
|
975
929
|
|
976
930
|
|
977
931
|
</div>
|
@@ -988,8 +942,6 @@
|
|
988
942
|
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
989
943
|
|
990
944
|
|
991
|
-
<em class="default">(defaults to: <tt>false</tt>)</em>
|
992
|
-
|
993
945
|
|
994
946
|
—
|
995
947
|
<div class='inline'><p>If to return the offset as a Rational.</p>
|
@@ -999,34 +951,30 @@
|
|
999
951
|
|
1000
952
|
<li>
|
1001
953
|
|
1002
|
-
<span class='name'>
|
1003
|
-
|
954
|
+
<span class='name'>dst</span>
|
1004
955
|
|
1005
|
-
<span class='type'>(<tt>Fixnum</tt>)</span>
|
1006
956
|
|
957
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1007
958
|
|
1008
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1009
959
|
|
1010
960
|
|
1011
961
|
—
|
1012
|
-
<div class='inline'><p>
|
962
|
+
<div class='inline'><p>If to return the offset when the DST is active.</p>
|
1013
963
|
</div>
|
1014
964
|
|
1015
965
|
</li>
|
1016
966
|
|
1017
967
|
<li>
|
1018
968
|
|
1019
|
-
<span class='name'>
|
1020
|
-
|
969
|
+
<span class='name'>year</span>
|
1021
970
|
|
1022
|
-
<span class='type'>(<tt>Symbol</tt>)</span>
|
1023
971
|
|
972
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
1024
973
|
|
1025
|
-
<em class="default">(defaults to: <tt>:utc_total_offset</tt>)</em>
|
1026
974
|
|
1027
975
|
|
1028
976
|
—
|
1029
|
-
<div class='inline'><p>The
|
977
|
+
<div class='inline'><p>The year to which refer to. Defaults to the current year.</p>
|
1030
978
|
</div>
|
1031
979
|
|
1032
980
|
</li>
|
@@ -1044,7 +992,7 @@
|
|
1044
992
|
|
1045
993
|
|
1046
994
|
—
|
1047
|
-
<div class='inline'><p>The
|
995
|
+
<div class='inline'><p>The offset of this timezone.</p>
|
1048
996
|
</div>
|
1049
997
|
|
1050
998
|
</li>
|
@@ -1057,18 +1005,30 @@
|
|
1057
1005
|
<pre class="lines">
|
1058
1006
|
|
1059
1007
|
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1008
|
+
202
|
1009
|
+
203
|
1010
|
+
204
|
1011
|
+
205
|
1012
|
+
206
|
1013
|
+
207
|
1014
|
+
208
|
1015
|
+
209
|
1016
|
+
210
|
1017
|
+
211
|
1018
|
+
212</pre>
|
1065
1019
|
</td>
|
1066
1020
|
<td>
|
1067
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
1021
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 202</span>
|
1022
|
+
|
1023
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='label'>rational:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>dst:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>year:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1024
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span>
|
1025
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_dst'>dst</span>
|
1026
|
+
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</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>
|
1027
|
+
<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_utc_total_offset'>utc_total_offset</span> <span class='op'>:</span> <span class='int'>0</span>
|
1028
|
+
<span class='kw'>else</span>
|
1029
|
+
<span class='id identifier rubyid_utc_offset'>utc_offset</span>
|
1030
|
+
<span class='kw'>end</span>
|
1068
1031
|
|
1069
|
-
<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>
|
1070
|
-
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</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>
|
1071
|
-
<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>
|
1072
1032
|
<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>
|
1073
1033
|
<span class='kw'>end</span></pre>
|
1074
1034
|
</td>
|
@@ -1077,9 +1037,9 @@
|
|
1077
1037
|
</div>
|
1078
1038
|
|
1079
1039
|
<div class="method_details ">
|
1080
|
-
<h3 class="signature " id="
|
1040
|
+
<h3 class="signature " id="to_str-instance_method">
|
1081
1041
|
|
1082
|
-
- (<tt>
|
1042
|
+
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>to_str</strong>(dst = false, **args)
|
1083
1043
|
|
1084
1044
|
|
1085
1045
|
|
@@ -1087,7 +1047,7 @@
|
|
1087
1047
|
|
1088
1048
|
</h3><div class="docstring">
|
1089
1049
|
<div class="discussion">
|
1090
|
-
<p>
|
1050
|
+
<p>Formats this zone as a string.</p>
|
1091
1051
|
|
1092
1052
|
|
1093
1053
|
</div>
|
@@ -1098,411 +1058,43 @@
|
|
1098
1058
|
|
1099
1059
|
<li>
|
1100
1060
|
|
1101
|
-
<span class='name'>
|
1061
|
+
<span class='name'>dst</span>
|
1102
1062
|
|
1103
1063
|
|
1104
|
-
<span class='type'>(<tt>
|
1105
|
-
|
1106
|
-
|
1107
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1108
|
-
|
1109
|
-
|
1110
|
-
—
|
1111
|
-
<div class='inline'><p>The year to which refer to. Defaults to the current year.</p>
|
1112
|
-
</div>
|
1113
|
-
|
1114
|
-
</li>
|
1115
|
-
|
1116
|
-
</ul>
|
1117
|
-
|
1118
|
-
<p class="tag_title">Returns:</p>
|
1119
|
-
<ul class="return">
|
1120
|
-
|
1121
|
-
<li>
|
1122
|
-
|
1123
|
-
|
1124
|
-
<span class='type'>(<tt>TimezonePeriod</tt>)</span>
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
—
|
1129
|
-
<div class='inline'><p>A period when the Daylight Saving Time (DST) is active or <code>nil</code> if the timezone doesn’t use DST for that year.</p>
|
1130
|
-
</div>
|
1131
|
-
|
1132
|
-
</li>
|
1133
|
-
|
1134
|
-
</ul>
|
1135
|
-
|
1136
|
-
</div><table class="source_code">
|
1137
|
-
<tr>
|
1138
|
-
<td>
|
1139
|
-
<pre class="lines">
|
1140
|
-
|
1141
|
-
|
1142
|
-
204
|
1143
|
-
205
|
1144
|
-
206
|
1145
|
-
207
|
1146
|
-
208
|
1147
|
-
209
|
1148
|
-
210
|
1149
|
-
211
|
1150
|
-
212
|
1151
|
-
213</pre>
|
1152
|
-
</td>
|
1153
|
-
<td>
|
1154
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 204</span>
|
1155
|
-
|
1156
|
-
<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>
|
1157
|
-
<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>
|
1158
|
-
|
1159
|
-
<span class='id identifier rubyid_northern_summer'>northern_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.
|
1160
|
-
</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 Southern Hemisphere.
|
1161
|
-
</span>
|
1162
|
-
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</span> <span class='id identifier rubyid_period_for_utc'>period_for_utc</span><span class='lparen'>(</span><span class='id identifier rubyid_northern_summer'>northern_summer</span><span class='rparen'>)</span>
|
1163
|
-
<span class='id identifier rubyid_period'>period</span> <span class='op'>=</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'>unless</span> <span class='id identifier rubyid_period'>period</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span>
|
1164
|
-
<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>
|
1165
|
-
<span class='kw'>end</span></pre>
|
1166
|
-
</td>
|
1167
|
-
</tr>
|
1168
|
-
</table>
|
1169
|
-
</div>
|
1170
|
-
|
1171
|
-
<div class="method_details ">
|
1172
|
-
<h3 class="signature " id="offset-instance_method">
|
1173
|
-
|
1174
|
-
- (<tt>Fixnum|Rational</tt>) <strong>offset</strong>(rational = false)
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
</h3><div class="docstring">
|
1181
|
-
<div class="discussion">
|
1182
|
-
<p>Returns the standard offset for this timezone.</p>
|
1183
|
-
|
1184
|
-
|
1185
|
-
</div>
|
1186
|
-
</div>
|
1187
|
-
<div class="tags">
|
1188
|
-
<p class="tag_title">Parameters:</p>
|
1189
|
-
<ul class="param">
|
1190
|
-
|
1191
|
-
<li>
|
1192
|
-
|
1193
|
-
<span class='name'>rational</span>
|
1194
|
-
|
1195
|
-
|
1196
|
-
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1064
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1197
1065
|
|
1198
1066
|
|
1199
1067
|
<em class="default">(defaults to: <tt>false</tt>)</em>
|
1200
1068
|
|
1201
1069
|
|
1202
1070
|
—
|
1203
|
-
<div class='inline'><p>If to
|
1204
|
-
</div>
|
1205
|
-
|
1206
|
-
</li>
|
1207
|
-
|
1208
|
-
</ul>
|
1209
|
-
|
1210
|
-
<p class="tag_title">Returns:</p>
|
1211
|
-
<ul class="return">
|
1212
|
-
|
1213
|
-
<li>
|
1214
|
-
|
1215
|
-
|
1216
|
-
<span class='type'>(<tt>Fixnum|Rational</tt>)</span>
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
—
|
1221
|
-
<div class='inline'><p>The offset of this timezone.</p>
|
1222
|
-
</div>
|
1223
|
-
|
1224
|
-
</li>
|
1225
|
-
|
1226
|
-
</ul>
|
1227
|
-
|
1228
|
-
</div><table class="source_code">
|
1229
|
-
<tr>
|
1230
|
-
<td>
|
1231
|
-
<pre class="lines">
|
1232
|
-
|
1233
|
-
|
1234
|
-
196
|
1235
|
-
197
|
1236
|
-
198</pre>
|
1237
|
-
</td>
|
1238
|
-
<td>
|
1239
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 196</span>
|
1240
|
-
|
1241
|
-
<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>
|
1242
|
-
<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_utc_offset'>utc_offset</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_utc_offset'>utc_offset</span>
|
1243
|
-
<span class='kw'>end</span></pre>
|
1244
|
-
</td>
|
1245
|
-
</tr>
|
1246
|
-
</table>
|
1247
|
-
</div>
|
1248
|
-
|
1249
|
-
<div class="method_details ">
|
1250
|
-
<h3 class="signature " id="to_str-instance_method">
|
1251
|
-
|
1252
|
-
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>to_str</strong>(name = nil, colon = true)
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
</h3><div class="docstring">
|
1259
|
-
<div class="discussion">
|
1260
|
-
<p>Returns the name for this zone with Daylight Saving Time (DST) active.</p>
|
1261
|
-
|
1262
|
-
|
1263
|
-
</div>
|
1264
|
-
</div>
|
1265
|
-
<div class="tags">
|
1266
|
-
<p class="tag_title">Parameters:</p>
|
1267
|
-
<ul class="param">
|
1268
|
-
|
1269
|
-
<li>
|
1270
|
-
|
1271
|
-
<span class='name'>name</span>
|
1272
|
-
|
1273
|
-
|
1274
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1275
|
-
|
1276
|
-
|
1277
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1278
|
-
|
1279
|
-
|
1280
|
-
—
|
1281
|
-
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1282
|
-
</div>
|
1283
|
-
|
1284
|
-
</li>
|
1285
|
-
|
1286
|
-
<li>
|
1287
|
-
|
1288
|
-
<span class='name'>colon</span>
|
1289
|
-
|
1290
|
-
|
1291
|
-
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1292
|
-
|
1293
|
-
|
1294
|
-
<em class="default">(defaults to: <tt>true</tt>)</em>
|
1295
|
-
|
1296
|
-
|
1297
|
-
—
|
1298
|
-
<div class='inline'><p>If to put the colon in the output string.</p>
|
1299
|
-
</div>
|
1300
|
-
|
1301
|
-
</li>
|
1302
|
-
|
1303
|
-
</ul>
|
1304
|
-
|
1305
|
-
<p class="tag_title">Returns:</p>
|
1306
|
-
<ul class="return">
|
1307
|
-
|
1308
|
-
<li>
|
1309
|
-
|
1310
|
-
|
1311
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
—
|
1316
|
-
<div class='inline'><p>The name for this zone.</p>
|
1317
|
-
</div>
|
1318
|
-
|
1319
|
-
</li>
|
1320
|
-
|
1321
|
-
</ul>
|
1322
|
-
|
1323
|
-
</div><table class="source_code">
|
1324
|
-
<tr>
|
1325
|
-
<td>
|
1326
|
-
<pre class="lines">
|
1327
|
-
|
1328
|
-
|
1329
|
-
263
|
1330
|
-
264
|
1331
|
-
265</pre>
|
1332
|
-
</td>
|
1333
|
-
<td>
|
1334
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 263</span>
|
1335
|
-
|
1336
|
-
<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>
|
1337
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(GMT</span><span class='embexpr_beg'>#{</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='embexpr_end'>}</span><span class='tstring_content'>) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='id identifier rubyid_current_alias'>current_alias</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1338
|
-
<span class='kw'>end</span></pre>
|
1339
|
-
</td>
|
1340
|
-
</tr>
|
1341
|
-
</table>
|
1342
|
-
</div>
|
1343
|
-
|
1344
|
-
<div class="method_details ">
|
1345
|
-
<h3 class="signature " id="to_str_parameterized-instance_method">
|
1346
|
-
|
1347
|
-
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>to_str_parameterized</strong>(with_offset = true, name = nil)
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
</h3><div class="docstring">
|
1354
|
-
<div class="discussion">
|
1355
|
-
<p>Returns a parameterized string representation for this zone.</p>
|
1356
|
-
|
1357
|
-
|
1358
|
-
</div>
|
1359
|
-
</div>
|
1360
|
-
<div class="tags">
|
1361
|
-
<p class="tag_title">Parameters:</p>
|
1362
|
-
<ul class="param">
|
1363
|
-
|
1364
|
-
<li>
|
1365
|
-
|
1366
|
-
<span class='name'>with_offset</span>
|
1367
|
-
|
1368
|
-
|
1369
|
-
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
1370
|
-
|
1371
|
-
|
1372
|
-
<em class="default">(defaults to: <tt>true</tt>)</em>
|
1373
|
-
|
1374
|
-
|
1375
|
-
—
|
1376
|
-
<div class='inline'><p>If to include offset into the representation.</p>
|
1071
|
+
<div class='inline'><p>If to represent with (DST) active.</p>
|
1377
1072
|
</div>
|
1378
1073
|
|
1379
1074
|
</li>
|
1380
1075
|
|
1381
1076
|
<li>
|
1382
1077
|
|
1383
|
-
<span class='name'>
|
1384
|
-
|
1385
|
-
|
1386
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1387
|
-
|
1388
|
-
|
1389
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1390
|
-
|
1391
|
-
|
1392
|
-
—
|
1393
|
-
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1394
|
-
</div>
|
1395
|
-
|
1396
|
-
</li>
|
1397
|
-
|
1398
|
-
</ul>
|
1399
|
-
|
1400
|
-
<p class="tag_title">Returns:</p>
|
1401
|
-
<ul class="return">
|
1402
|
-
|
1403
|
-
<li>
|
1078
|
+
<span class='name'>args</span>
|
1404
1079
|
|
1405
1080
|
|
1406
|
-
<span class='type'>(<tt><span class='object_link'><a href="
|
1081
|
+
<span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span>
|
1407
1082
|
|
1408
1083
|
|
1409
1084
|
|
1410
1085
|
—
|
1411
|
-
<div class='inline'><p>
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1086
|
+
<div class='inline'><p>Parameters for the formatting:</p>
|
1087
|
+
|
1088
|
+
<ul>
|
1089
|
+
<li><strong>label</strong> (<code>String</code>): The label to use. Default to the current alias.</li>
|
1090
|
+
<li><strong>dst_label</strong> (<code>String</code>): Label for the DST indication. Defaults to ` (DST)`.</li>
|
1091
|
+
<li><strong>utc_label</strong> (<code>String</code>): Label for the UTC name. Defaults to <code>GMT</code>. *Only used when <code>parameterized</code> is <code>false</code>.</li>
|
1092
|
+
<li><strong>year</strong> (<code>Fixnum</code>): The year to which refer to. Defaults to the current year.</li>
|
1093
|
+
<li><strong>parameterized</strong> (<code>Boolean</code>): If to represent as parameterized.</li>
|
1094
|
+
<li><strong>with_offset</strong> (<code>Boolean</code>): If to include offset into the representation. *Only used when <code>parameterized</code> is <code>true</code>.</li>
|
1095
|
+
<li><strong>offset_position</strong> (<code>Symbol</code>): Where to put the offset. Valid values are <code>:begin</code> or <code>:end</code>. *Only used when <code>parameterized</code> is <code>false</code>.</li>
|
1096
|
+
<li><strong>colon</strong> (<code>Boolean</code>): If include a colon in the offset. *Only used when <code>parameterized</code> is <code>false</code>.</li>
|
1416
1097
|
</ul>
|
1417
|
-
|
1418
|
-
</div><table class="source_code">
|
1419
|
-
<tr>
|
1420
|
-
<td>
|
1421
|
-
<pre class="lines">
|
1422
|
-
|
1423
|
-
|
1424
|
-
282
|
1425
|
-
283
|
1426
|
-
284</pre>
|
1427
|
-
</td>
|
1428
|
-
<td>
|
1429
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 282</span>
|
1430
|
-
|
1431
|
-
<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>
|
1432
|
-
<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='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>
|
1433
|
-
<span class='kw'>end</span></pre>
|
1434
|
-
</td>
|
1435
|
-
</tr>
|
1436
|
-
</table>
|
1437
|
-
</div>
|
1438
|
-
|
1439
|
-
<div class="method_details ">
|
1440
|
-
<h3 class="signature " id="to_str_with_dst-instance_method">
|
1441
|
-
|
1442
|
-
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>to_str_with_dst</strong>(dst_label = nil, year = nil, name = nil)
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
</h3><div class="docstring">
|
1449
|
-
<div class="discussion">
|
1450
|
-
<p>Returns a string representation for this zone with Daylight Saving Time (DST) active.</p>
|
1451
|
-
|
1452
|
-
|
1453
|
-
</div>
|
1454
|
-
</div>
|
1455
|
-
<div class="tags">
|
1456
|
-
<p class="tag_title">Parameters:</p>
|
1457
|
-
<ul class="param">
|
1458
|
-
|
1459
|
-
<li>
|
1460
|
-
|
1461
|
-
<span class='name'>dst_label</span>
|
1462
|
-
|
1463
|
-
|
1464
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1465
|
-
|
1466
|
-
|
1467
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1468
|
-
|
1469
|
-
|
1470
|
-
—
|
1471
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
1472
|
-
</div>
|
1473
|
-
|
1474
|
-
</li>
|
1475
|
-
|
1476
|
-
<li>
|
1477
|
-
|
1478
|
-
<span class='name'>year</span>
|
1479
|
-
|
1480
|
-
|
1481
|
-
<span class='type'>(<tt>Fixnum</tt>)</span>
|
1482
|
-
|
1483
|
-
|
1484
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1485
|
-
|
1486
|
-
|
1487
|
-
—
|
1488
|
-
<div class='inline'><p>The year to which refer to. Defaults to the current year.</p>
|
1489
|
-
</div>
|
1490
|
-
|
1491
|
-
</li>
|
1492
|
-
|
1493
|
-
<li>
|
1494
|
-
|
1495
|
-
<span class='name'>name</span>
|
1496
|
-
|
1497
|
-
|
1498
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1499
|
-
|
1500
|
-
|
1501
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1502
|
-
|
1503
|
-
|
1504
|
-
—
|
1505
|
-
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1506
1098
|
</div>
|
1507
1099
|
|
1508
1100
|
</li>
|
@@ -1520,7 +1112,7 @@
|
|
1520
1112
|
|
1521
1113
|
|
1522
1114
|
—
|
1523
|
-
<div class='inline'><p>The string representation for
|
1115
|
+
<div class='inline'><p>The string representation for this zone.</p>
|
1524
1116
|
</div>
|
1525
1117
|
|
1526
1118
|
</li>
|
@@ -1533,129 +1125,35 @@
|
|
1533
1125
|
<pre class="lines">
|
1534
1126
|
|
1535
1127
|
|
1128
|
+
265
|
1129
|
+
266
|
1130
|
+
267
|
1131
|
+
268
|
1132
|
+
269
|
1133
|
+
270
|
1134
|
+
271
|
1135
|
+
272
|
1536
1136
|
273
|
1537
1137
|
274
|
1538
|
-
275
|
1138
|
+
275
|
1139
|
+
276
|
1140
|
+
277</pre>
|
1539
1141
|
</td>
|
1540
1142
|
<td>
|
1541
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
1143
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 265</span>
|
1542
1144
|
|
1543
|
-
<span class='kw'>def</span> <span class='id identifier
|
1544
|
-
<span class='
|
1545
|
-
<span class='
|
1546
|
-
</td>
|
1547
|
-
</tr>
|
1548
|
-
</table>
|
1549
|
-
</div>
|
1550
|
-
|
1551
|
-
<div class="method_details ">
|
1552
|
-
<h3 class="signature " id="to_str_with_dst_parameterized-instance_method">
|
1553
|
-
|
1554
|
-
- (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>to_str_with_dst_parameterized</strong>(dst_label = nil, year = nil, name = nil)
|
1555
|
-
|
1145
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_str'>to_str</span><span class='lparen'>(</span><span class='id identifier rubyid_dst'>dst</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1146
|
+
<span class='comment'># PI: Ignore reek on this.
|
1147
|
+
</span> <span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='id identifier rubyid_utc_label'>utc_label</span><span class='comma'>,</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_parameterized'>parameterized</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='comma'>,</span> <span class='id identifier rubyid_colon'>colon</span><span class='comma'>,</span> <span class='id identifier rubyid_offset_position'>offset_position</span> <span class='op'>=</span> <span class='id identifier rubyid_prepare_to_str_arguments'>prepare_to_str_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1556
1148
|
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
</
|
1561
|
-
|
1562
|
-
<p>Returns a parameterized string representation for this zone with Daylight Saving Time (DST) active.</p>
|
1563
|
-
|
1564
|
-
|
1565
|
-
</div>
|
1566
|
-
</div>
|
1567
|
-
<div class="tags">
|
1568
|
-
<p class="tag_title">Parameters:</p>
|
1569
|
-
<ul class="param">
|
1570
|
-
|
1571
|
-
<li>
|
1572
|
-
|
1573
|
-
<span class='name'>dst_label</span>
|
1574
|
-
|
1575
|
-
|
1576
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1577
|
-
|
1578
|
-
|
1579
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1580
|
-
|
1581
|
-
|
1582
|
-
—
|
1583
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
1584
|
-
</div>
|
1585
|
-
|
1586
|
-
</li>
|
1587
|
-
|
1588
|
-
<li>
|
1589
|
-
|
1590
|
-
<span class='name'>year</span>
|
1591
|
-
|
1592
|
-
|
1593
|
-
<span class='type'>(<tt>Fixnum</tt>)</span>
|
1594
|
-
|
1595
|
-
|
1596
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1597
|
-
|
1598
|
-
|
1599
|
-
—
|
1600
|
-
<div class='inline'><p>The year to which refer to. Defaults to the current year.</p>
|
1601
|
-
</div>
|
1602
|
-
|
1603
|
-
</li>
|
1604
|
-
|
1605
|
-
<li>
|
1606
|
-
|
1607
|
-
<span class='name'>name</span>
|
1608
|
-
|
1609
|
-
|
1610
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1611
|
-
|
1612
|
-
|
1613
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1614
|
-
|
1615
|
-
|
1616
|
-
—
|
1617
|
-
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1618
|
-
</div>
|
1619
|
-
|
1620
|
-
</li>
|
1621
|
-
|
1622
|
-
</ul>
|
1623
|
-
|
1624
|
-
<p class="tag_title">Returns:</p>
|
1625
|
-
<ul class="return">
|
1626
|
-
|
1627
|
-
<li>
|
1628
|
-
|
1629
|
-
|
1630
|
-
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
—
|
1635
|
-
<div class='inline'><p>The parameterized string representation for this zone with DST or <code>nil</code>, if the timezone doesn’t use DST for that year.</p>
|
1636
|
-
</div>
|
1637
|
-
|
1638
|
-
</li>
|
1639
|
-
|
1640
|
-
</ul>
|
1641
|
-
|
1642
|
-
</div><table class="source_code">
|
1643
|
-
<tr>
|
1644
|
-
<td>
|
1645
|
-
<pre class="lines">
|
1646
|
-
|
1647
|
-
|
1648
|
-
292
|
1649
|
-
293
|
1650
|
-
294
|
1651
|
-
295</pre>
|
1652
|
-
</td>
|
1653
|
-
<td>
|
1654
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 292</span>
|
1149
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_parameterized'>parameterized</span>
|
1150
|
+
<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_parameterize'>parameterize</span><span class='lparen'>(</span><span class='id identifier rubyid_to_str'>to_str</span><span class='lparen'>(</span><span class='id identifier rubyid_dst'>dst</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='label'>dst_label:</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='label'>utc_label:</span> <span class='id identifier rubyid_utc_label'>utc_label</span><span class='comma'>,</span> <span class='label'>year:</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='label'>parameterized:</span> <span class='kw'>false</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='rparen'>)</span>
|
1151
|
+
<span class='kw'>else</span>
|
1152
|
+
<span class='id identifier rubyid_offset_label'>offset_label</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_offset'>offset</span><span class='lparen'>(</span><span class='label'>rational:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>dst:</span> <span class='id identifier rubyid_dst'>dst</span><span class='comma'>,</span> <span class='label'>year:</span> <span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_colon'>colon</span><span class='rparen'>)</span>
|
1153
|
+
<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_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_dst'>dst</span>
|
1655
1154
|
|
1656
|
-
<span class='
|
1657
|
-
<span class='
|
1658
|
-
<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>
|
1155
|
+
<span class='id identifier rubyid_to_str_unparameterized'>to_str_unparameterized</span><span class='lparen'>(</span><span class='id identifier rubyid_dst_label'>dst_label</span><span class='comma'>,</span> <span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_offset_label'>offset_label</span><span class='comma'>,</span> <span class='id identifier rubyid_offset_position'>offset_position</span><span class='comma'>,</span> <span class='id identifier rubyid_utc_label'>utc_label</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='rparen'>)</span>
|
1156
|
+
<span class='kw'>end</span>
|
1659
1157
|
<span class='kw'>end</span></pre>
|
1660
1158
|
</td>
|
1661
1159
|
</tr>
|
@@ -1687,7 +1185,7 @@
|
|
1687
1185
|
<span class='name'>reference</span>
|
1688
1186
|
|
1689
1187
|
|
1690
|
-
<span class='type'>(<tt
|
1188
|
+
<span class='type'>(<tt>Date|<span class='object_link'><a href="DateTime.html" title="Lazier::DateTime (module)">DateTime</a></span></tt>)</span>
|
1691
1189
|
|
1692
1190
|
|
1693
1191
|
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
@@ -1725,22 +1223,22 @@
|
|
1725
1223
|
<pre class="lines">
|
1726
1224
|
|
1727
1225
|
|
1226
|
+
218
|
1728
1227
|
219
|
1729
1228
|
220
|
1730
1229
|
221
|
1731
1230
|
222
|
1732
1231
|
223
|
1733
|
-
224
|
1734
|
-
225</pre>
|
1232
|
+
224</pre>
|
1735
1233
|
</td>
|
1736
1234
|
<td>
|
1737
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line
|
1235
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/timezone.rb', line 218</span>
|
1738
1236
|
|
1739
1237
|
<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>
|
1740
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier
|
1741
|
-
|
1238
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_reference'>reference</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Date</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_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>DateTime</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_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span>
|
1239
|
+
<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='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dst?'>dst?</span>
|
1742
1240
|
<span class='kw'>else</span>
|
1743
|
-
<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
|
1241
|
+
<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>
|
1744
1242
|
<span class='kw'>end</span>
|
1745
1243
|
<span class='kw'>end</span></pre>
|
1746
1244
|
</td>
|
@@ -1753,7 +1251,7 @@
|
|
1753
1251
|
</div>
|
1754
1252
|
|
1755
1253
|
<div id="footer">
|
1756
|
-
Generated on
|
1254
|
+
Generated on Sun Jun 1 15:50:06 2014 by
|
1757
1255
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1758
1256
|
0.8.7.4 (ruby-2.1.2).
|
1759
1257
|
</div>
|