cowtech-extensions 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/Cowtech.html +1 -1
- data/doc/Cowtech/Extensions.html +1 -1
- data/doc/Cowtech/Extensions/Boolean.html +1 -1
- data/doc/Cowtech/Extensions/DateTime.html +1 -1
- data/doc/Cowtech/Extensions/DateTime/ClassMethods.html +4 -4
- data/doc/Cowtech/Extensions/Exceptions.html +1 -1
- data/doc/Cowtech/Extensions/Exceptions/Dump.html +1 -1
- data/doc/Cowtech/Extensions/Hash.html +1 -1
- data/doc/Cowtech/Extensions/Math.html +1 -1
- data/doc/Cowtech/Extensions/Math/ClassMethods.html +1 -1
- data/doc/Cowtech/Extensions/Object.html +1 -1
- data/doc/Cowtech/Extensions/Pathname.html +1 -1
- data/doc/Cowtech/Extensions/Settings.html +1 -1
- data/doc/Cowtech/Extensions/String.html +1 -1
- data/doc/Cowtech/Extensions/TimeZone.html +445 -110
- data/doc/Cowtech/Extensions/TimeZone/ClassMethods.html +165 -35
- data/doc/Cowtech/Extensions/Version.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +38 -14
- data/doc/top-level-namespace.html +1 -1
- data/lib/cowtech-extensions/datetime.rb +95 -33
- data/lib/cowtech-extensions/version.rb +1 -1
- data/spec/cowtech-extensions/datetime_spec.rb +33 -30
- metadata +2 -2
data/doc/Cowtech.html
CHANGED
@@ -119,7 +119,7 @@ Licensed under the MIT license, which can be found at <a href="http://www.openso
|
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div id="footer">
|
122
|
-
Generated on
|
122
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
124
|
0.8.2.1 (ruby-1.9.2).
|
125
125
|
</div>
|
data/doc/Cowtech/Extensions.html
CHANGED
@@ -547,7 +547,7 @@
|
|
547
547
|
</div>
|
548
548
|
|
549
549
|
<div id="footer">
|
550
|
-
Generated on
|
550
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
551
551
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
552
552
|
0.8.2.1 (ruby-1.9.2).
|
553
553
|
</div>
|
@@ -288,7 +288,7 @@
|
|
288
288
|
</div>
|
289
289
|
|
290
290
|
<div id="footer">
|
291
|
-
Generated on
|
291
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
292
292
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
293
293
|
0.8.2.1 (ruby-1.9.2).
|
294
294
|
</div>
|
@@ -778,7 +778,7 @@
|
|
778
778
|
</div>
|
779
779
|
|
780
780
|
<div id="footer">
|
781
|
-
Generated on
|
781
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
782
782
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
783
783
|
0.8.2.1 (ruby-1.9.2).
|
784
784
|
</div>
|
@@ -740,7 +740,7 @@
|
|
740
740
|
|
741
741
|
|
742
742
|
—
|
743
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
743
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
744
744
|
</div>
|
745
745
|
|
746
746
|
</li>
|
@@ -955,7 +955,7 @@
|
|
955
955
|
|
956
956
|
|
957
957
|
—
|
958
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
958
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
959
959
|
</div>
|
960
960
|
|
961
961
|
</li>
|
@@ -1386,7 +1386,7 @@
|
|
1386
1386
|
|
1387
1387
|
|
1388
1388
|
—
|
1389
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
1389
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
1390
1390
|
</div>
|
1391
1391
|
|
1392
1392
|
</li>
|
@@ -1583,7 +1583,7 @@
|
|
1583
1583
|
</div>
|
1584
1584
|
|
1585
1585
|
<div id="footer">
|
1586
|
-
Generated on
|
1586
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
1587
1587
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1588
1588
|
0.8.2.1 (ruby-1.9.2).
|
1589
1589
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.2.1 (ruby-1.9.2).
|
122
122
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.2.1 (ruby-1.9.2).
|
130
130
|
</div>
|
@@ -384,7 +384,7 @@
|
|
384
384
|
</div>
|
385
385
|
|
386
386
|
<div id="footer">
|
387
|
-
Generated on
|
387
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
388
388
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
389
389
|
0.8.2.1 (ruby-1.9.2).
|
390
390
|
</div>
|
@@ -121,7 +121,7 @@
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on
|
124
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.8.2.1 (ruby-1.9.2).
|
127
127
|
</div>
|
@@ -353,7 +353,7 @@
|
|
353
353
|
</div>
|
354
354
|
|
355
355
|
<div id="footer">
|
356
|
-
Generated on
|
356
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
357
357
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
358
358
|
0.8.2.1 (ruby-1.9.2).
|
359
359
|
</div>
|
@@ -1556,7 +1556,7 @@
|
|
1556
1556
|
</div>
|
1557
1557
|
|
1558
1558
|
<div id="footer">
|
1559
|
-
Generated on
|
1559
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
1560
1560
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1561
1561
|
0.8.2.1 (ruby-1.9.2).
|
1562
1562
|
</div>
|
@@ -216,7 +216,7 @@
|
|
216
216
|
</div>
|
217
217
|
|
218
218
|
<div id="footer">
|
219
|
-
Generated on
|
219
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
220
220
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
221
221
|
0.8.2.1 (ruby-1.9.2).
|
222
222
|
</div>
|
@@ -1240,7 +1240,7 @@
|
|
1240
1240
|
</div>
|
1241
1241
|
|
1242
1242
|
<div id="footer">
|
1243
|
-
Generated on
|
1243
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
1244
1244
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1245
1245
|
0.8.2.1 (ruby-1.9.2).
|
1246
1246
|
</div>
|
@@ -462,7 +462,7 @@
|
|
462
462
|
</div>
|
463
463
|
|
464
464
|
<div id="footer">
|
465
|
-
Generated on
|
465
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
466
466
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
467
467
|
0.8.2.1 (ruby-1.9.2).
|
468
468
|
</div>
|
@@ -126,6 +126,29 @@
|
|
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>(dst_label = nil) </a>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<span class="summary_desc"><div class='inline'><p>Returns a list of valid aliases (city names) for this timezone (basing on offset).</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
129
152
|
<a href="#current_offset-instance_method" title="#current_offset (instance method)">- (Fixnum|Rational) <strong>current_offset</strong>(rational = false, date = nil) </a>
|
130
153
|
|
131
154
|
|
@@ -140,7 +163,7 @@
|
|
140
163
|
|
141
164
|
|
142
165
|
|
143
|
-
<span class="summary_desc"><div class='inline'><p>Returns the current offset for this timezone, taking care of DST (
|
166
|
+
<span class="summary_desc"><div class='inline'><p>Returns the current offset for this timezone, taking care of DST (DST).</p>
|
144
167
|
</div></span>
|
145
168
|
|
146
169
|
</li>
|
@@ -163,7 +186,7 @@
|
|
163
186
|
|
164
187
|
|
165
188
|
|
166
|
-
<span class="summary_desc"><div class='inline'><p>Return the correction applied to the standard offset the timezone when the DST (
|
189
|
+
<span class="summary_desc"><div class='inline'><p>Return the correction applied to the standard offset the timezone when the DST (DST) is active.</p>
|
167
190
|
</div></span>
|
168
191
|
|
169
192
|
</li>
|
@@ -172,7 +195,7 @@
|
|
172
195
|
<li class="public ">
|
173
196
|
<span class="summary_signature">
|
174
197
|
|
175
|
-
<a href="#dst_name-instance_method" title="#dst_name (instance method)">- (String) <strong>dst_name</strong>(dst_label = nil, year = nil) </a>
|
198
|
+
<a href="#dst_name-instance_method" title="#dst_name (instance method)">- (String) <strong>dst_name</strong>(dst_label = nil, year = nil, name = nil) </a>
|
176
199
|
|
177
200
|
|
178
201
|
|
@@ -186,7 +209,7 @@
|
|
186
209
|
|
187
210
|
|
188
211
|
|
189
|
-
<span class="summary_desc"><div class='inline'><p>Returns the name for this zone with DST (
|
212
|
+
<span class="summary_desc"><div class='inline'><p>Returns the name for this zone with DST (DST) active.</p>
|
190
213
|
</div></span>
|
191
214
|
|
192
215
|
</li>
|
@@ -209,7 +232,7 @@
|
|
209
232
|
|
210
233
|
|
211
234
|
|
212
|
-
<span class="summary_desc"><div class='inline'><p>Returns the standard offset for this timezone timezone when the DST (
|
235
|
+
<span class="summary_desc"><div class='inline'><p>Returns the standard offset for this timezone timezone when the DST (DST) is active.</p>
|
213
236
|
</div></span>
|
214
237
|
|
215
238
|
</li>
|
@@ -232,7 +255,7 @@
|
|
232
255
|
|
233
256
|
|
234
257
|
|
235
|
-
<span class="summary_desc"><div class='inline'><p>Gets a period for this timezone when the DST (
|
258
|
+
<span class="summary_desc"><div class='inline'><p>Gets a period for this timezone when the DST (DST) is active (it takes care of different hemispheres).</p>
|
236
259
|
</div></span>
|
237
260
|
|
238
261
|
</li>
|
@@ -264,7 +287,30 @@
|
|
264
287
|
<li class="public ">
|
265
288
|
<span class="summary_signature">
|
266
289
|
|
267
|
-
<a href="#
|
290
|
+
<a href="#to_str-instance_method" title="#to_str (instance method)">- (String) <strong>to_str</strong>(name = nil, colon = true) </a>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
</span>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<span class="summary_desc"><div class='inline'><p>Returns the name for this zone with DST (DST) active.</p>
|
305
|
+
</div></span>
|
306
|
+
|
307
|
+
</li>
|
308
|
+
|
309
|
+
|
310
|
+
<li class="public ">
|
311
|
+
<span class="summary_signature">
|
312
|
+
|
313
|
+
<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>
|
268
314
|
|
269
315
|
|
270
316
|
|
@@ -287,7 +333,7 @@
|
|
287
333
|
<li class="public ">
|
288
334
|
<span class="summary_signature">
|
289
335
|
|
290
|
-
<a href="#
|
336
|
+
<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>
|
291
337
|
|
292
338
|
|
293
339
|
|
@@ -301,7 +347,7 @@
|
|
301
347
|
|
302
348
|
|
303
349
|
|
304
|
-
<span class="summary_desc"><div class='inline'><p>Returns a string representation for this zone with DST (
|
350
|
+
<span class="summary_desc"><div class='inline'><p>Returns a string representation for this zone with DST (DST) active.</p>
|
305
351
|
</div></span>
|
306
352
|
|
307
353
|
</li>
|
@@ -310,7 +356,7 @@
|
|
310
356
|
<li class="public ">
|
311
357
|
<span class="summary_signature">
|
312
358
|
|
313
|
-
<a href="#
|
359
|
+
<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, with_offset = true, year = nil, name = nil) </a>
|
314
360
|
|
315
361
|
|
316
362
|
|
@@ -324,7 +370,7 @@
|
|
324
370
|
|
325
371
|
|
326
372
|
|
327
|
-
<span class="summary_desc"><div class='inline'><p>Returns a parametized string representation for this zone with DST (
|
373
|
+
<span class="summary_desc"><div class='inline'><p>Returns a parametized string representation for this zone with DST (DST) active.</p>
|
328
374
|
</div></span>
|
329
375
|
|
330
376
|
</li>
|
@@ -347,7 +393,7 @@
|
|
347
393
|
|
348
394
|
|
349
395
|
|
350
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the timezone uses DST (
|
396
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the timezone uses DST (DST) for that year.</p>
|
351
397
|
</div></span>
|
352
398
|
|
353
399
|
</li>
|
@@ -364,7 +410,127 @@
|
|
364
410
|
|
365
411
|
|
366
412
|
<div class="method_details first">
|
367
|
-
<h3 class="signature first" id="
|
413
|
+
<h3 class="signature first" id="aliases-instance_method">
|
414
|
+
|
415
|
+
- (<tt>Array</tt>) <strong>aliases</strong>(dst_label = nil)
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
</h3><div class="docstring">
|
422
|
+
<div class="discussion">
|
423
|
+
<p>Returns a list of valid aliases (city names) for this timezone (basing on offset).</p>
|
424
|
+
|
425
|
+
|
426
|
+
</div>
|
427
|
+
</div>
|
428
|
+
<div class="tags">
|
429
|
+
<p class="tag_title">Parameters:</p>
|
430
|
+
<ul class="param">
|
431
|
+
|
432
|
+
<li>
|
433
|
+
|
434
|
+
<span class='name'>dst_label</span>
|
435
|
+
|
436
|
+
|
437
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
438
|
+
|
439
|
+
|
440
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
441
|
+
|
442
|
+
|
443
|
+
—
|
444
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
</li>
|
448
|
+
|
449
|
+
</ul>
|
450
|
+
|
451
|
+
<p class="tag_title">Returns:</p>
|
452
|
+
<ul class="return">
|
453
|
+
|
454
|
+
<li>
|
455
|
+
|
456
|
+
|
457
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
—
|
462
|
+
<div class='inline'><p>A list of aliases for this timezone</p>
|
463
|
+
</div>
|
464
|
+
|
465
|
+
</li>
|
466
|
+
|
467
|
+
</ul>
|
468
|
+
|
469
|
+
</div><table class="source_code">
|
470
|
+
<tr>
|
471
|
+
<td>
|
472
|
+
<pre class="lines">
|
473
|
+
|
474
|
+
|
475
|
+
389
|
476
|
+
390
|
477
|
+
391
|
478
|
+
392
|
479
|
+
393
|
480
|
+
394
|
481
|
+
395
|
482
|
+
396
|
483
|
+
397
|
484
|
+
398
|
485
|
+
399
|
486
|
+
400
|
487
|
+
401
|
488
|
+
402
|
489
|
+
403
|
490
|
+
404
|
491
|
+
405
|
492
|
+
406
|
493
|
+
407
|
494
|
+
408
|
495
|
+
409
|
496
|
+
410
|
497
|
+
411
|
498
|
+
412</pre>
|
499
|
+
</td>
|
500
|
+
<td>
|
501
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 389</span>
|
502
|
+
|
503
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_aliases'>aliases</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='rparen'>)</span>
|
504
|
+
<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_name'>name</span>
|
505
|
+
<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='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='kw'>if</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_has_key?'>has_key?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='comment'># We are an alias
|
506
|
+
</span> <span class='id identifier rubyid_reference'>reference</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='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>
|
507
|
+
|
508
|
+
<span class='kw'>if</span> <span class='ivar'>@aliases</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='kw'>then</span>
|
509
|
+
<span class='comment'># First we search for aliases by name
|
510
|
+
</span> <span class='ivar'>@aliases</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_reference'>reference</span><span class='rbracket'>]</span>
|
511
|
+
|
512
|
+
<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_each'>each</span> <span class='kw'>do</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>
|
513
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_zone'>zone</span> <span class='op'>==</span> <span class='id identifier rubyid_reference'>reference</span> <span class='kw'>then</span>
|
514
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>==</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='op'>||</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>UTC</span><span class='tstring_end'>"</span></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>
|
515
|
+
<span class='ivar'>@aliases</span> <span class='op'><<</span> <span class='id identifier rubyid_name'>name</span>
|
516
|
+
<span class='kw'>else</span>
|
517
|
+
<span class='ivar'>@aliases</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='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
518
|
+
<span class='kw'>end</span>
|
519
|
+
<span class='kw'>end</span>
|
520
|
+
<span class='kw'>end</span>
|
521
|
+
|
522
|
+
<span class='ivar'>@aliases</span> <span class='op'>=</span> <span class='ivar'>@aliases</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>
|
523
|
+
<span class='kw'>end</span>
|
524
|
+
|
525
|
+
<span class='ivar'>@aliases</span>
|
526
|
+
<span class='kw'>end</span></pre>
|
527
|
+
</td>
|
528
|
+
</tr>
|
529
|
+
</table>
|
530
|
+
</div>
|
531
|
+
|
532
|
+
<div class="method_details ">
|
533
|
+
<h3 class="signature " id="current_offset-instance_method">
|
368
534
|
|
369
535
|
- (<tt>Fixnum|Rational</tt>) <strong>current_offset</strong>(rational = false, date = nil)
|
370
536
|
|
@@ -374,7 +540,7 @@
|
|
374
540
|
|
375
541
|
</h3><div class="docstring">
|
376
542
|
<div class="discussion">
|
377
|
-
<p>Returns the current offset for this timezone, taking care of DST (
|
543
|
+
<p>Returns the current offset for this timezone, taking care of DST (DST).</p>
|
378
544
|
|
379
545
|
|
380
546
|
</div>
|
@@ -443,17 +609,17 @@
|
|
443
609
|
<pre class="lines">
|
444
610
|
|
445
611
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
612
|
+
419
|
613
|
+
420
|
614
|
+
421
|
615
|
+
422
|
616
|
+
423
|
617
|
+
424
|
618
|
+
425
|
619
|
+
426</pre>
|
454
620
|
</td>
|
455
621
|
<td>
|
456
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
622
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 419</span>
|
457
623
|
|
458
624
|
<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>
|
459
625
|
<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>
|
@@ -479,7 +645,7 @@
|
|
479
645
|
|
480
646
|
</h3><div class="docstring">
|
481
647
|
<div class="discussion">
|
482
|
-
<p>Return the correction applied to the standard offset the timezone when the DST (
|
648
|
+
<p>Return the correction applied to the standard offset the timezone when the DST (DST) is active.</p>
|
483
649
|
|
484
650
|
|
485
651
|
</div>
|
@@ -548,14 +714,14 @@
|
|
548
714
|
<pre class="lines">
|
549
715
|
|
550
716
|
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
717
|
+
465
|
718
|
+
466
|
719
|
+
467
|
720
|
+
468
|
721
|
+
469</pre>
|
556
722
|
</td>
|
557
723
|
<td>
|
558
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
724
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 465</span>
|
559
725
|
|
560
726
|
<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>
|
561
727
|
<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>
|
@@ -570,7 +736,7 @@
|
|
570
736
|
<div class="method_details ">
|
571
737
|
<h3 class="signature " id="dst_name-instance_method">
|
572
738
|
|
573
|
-
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>dst_name</strong>(dst_label = nil, year = nil)
|
739
|
+
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>dst_name</strong>(dst_label = nil, year = nil, name = nil)
|
574
740
|
|
575
741
|
|
576
742
|
|
@@ -578,7 +744,7 @@
|
|
578
744
|
|
579
745
|
</h3><div class="docstring">
|
580
746
|
<div class="discussion">
|
581
|
-
<p>Returns the name for this zone with DST (
|
747
|
+
<p>Returns the name for this zone with DST (DST) active.</p>
|
582
748
|
|
583
749
|
|
584
750
|
</div>
|
@@ -599,7 +765,7 @@
|
|
599
765
|
|
600
766
|
|
601
767
|
—
|
602
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
768
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
603
769
|
</div>
|
604
770
|
|
605
771
|
</li>
|
@@ -621,6 +787,23 @@
|
|
621
787
|
|
622
788
|
</li>
|
623
789
|
|
790
|
+
<li>
|
791
|
+
|
792
|
+
<span class='name'>name</span>
|
793
|
+
|
794
|
+
|
795
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
796
|
+
|
797
|
+
|
798
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
799
|
+
|
800
|
+
|
801
|
+
—
|
802
|
+
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
803
|
+
</div>
|
804
|
+
|
805
|
+
</li>
|
806
|
+
|
624
807
|
</ul>
|
625
808
|
|
626
809
|
<p class="tag_title">Returns:</p>
|
@@ -647,17 +830,19 @@
|
|
647
830
|
<pre class="lines">
|
648
831
|
|
649
832
|
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
833
|
+
488
|
834
|
+
489
|
835
|
+
490
|
836
|
+
491
|
837
|
+
492
|
838
|
+
493</pre>
|
655
839
|
</td>
|
656
840
|
<td>
|
657
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
841
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 488</span>
|
658
842
|
|
659
|
-
<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='rparen'>)</span>
|
660
|
-
<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'>(
|
843
|
+
<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>
|
844
|
+
<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>
|
845
|
+
<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>
|
661
846
|
|
662
847
|
<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>
|
663
848
|
<span class='kw'>end</span></pre>
|
@@ -677,7 +862,7 @@
|
|
677
862
|
|
678
863
|
</h3><div class="docstring">
|
679
864
|
<div class="discussion">
|
680
|
-
<p>Returns the standard offset for this timezone timezone when the DST (
|
865
|
+
<p>Returns the standard offset for this timezone timezone when the DST (DST) is active.</p>
|
681
866
|
|
682
867
|
|
683
868
|
</div>
|
@@ -733,7 +918,7 @@
|
|
733
918
|
|
734
919
|
|
735
920
|
—
|
736
|
-
<div class='inline'><p>The DST offset for this timezone or <code>0</code
|
921
|
+
<div class='inline'><p>The DST offset for this timezone or <code>0</code>, if the timezone doesn't use DST for that year.</p>
|
737
922
|
</div>
|
738
923
|
|
739
924
|
</li>
|
@@ -746,14 +931,14 @@
|
|
746
931
|
<pre class="lines">
|
747
932
|
|
748
933
|
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
934
|
+
476
|
935
|
+
477
|
936
|
+
478
|
937
|
+
479
|
938
|
+
480</pre>
|
754
939
|
</td>
|
755
940
|
<td>
|
756
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
941
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 476</span>
|
757
942
|
|
758
943
|
<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='rparen'>)</span>
|
759
944
|
<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>
|
@@ -776,7 +961,7 @@
|
|
776
961
|
|
777
962
|
</h3><div class="docstring">
|
778
963
|
<div class="discussion">
|
779
|
-
<p>Gets a period for this timezone when the DST (
|
964
|
+
<p>Gets a period for this timezone when the DST (DST) is active (it takes care of different hemispheres).</p>
|
780
965
|
|
781
966
|
|
782
967
|
</div>
|
@@ -815,7 +1000,7 @@
|
|
815
1000
|
|
816
1001
|
|
817
1002
|
—
|
818
|
-
<div class='inline'><p>A period when the DST (
|
1003
|
+
<div class='inline'><p>A period when the DST (DST) is active or <code>nil</code> if the timezone doesn't use DST for that year.</p>
|
819
1004
|
</div>
|
820
1005
|
|
821
1006
|
</li>
|
@@ -828,19 +1013,19 @@
|
|
828
1013
|
<pre class="lines">
|
829
1014
|
|
830
1015
|
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
1016
|
+
441
|
1017
|
+
442
|
1018
|
+
443
|
1019
|
+
444
|
1020
|
+
445
|
1021
|
+
446
|
1022
|
+
447
|
1023
|
+
448
|
1024
|
+
449
|
1025
|
+
450</pre>
|
841
1026
|
</td>
|
842
1027
|
<td>
|
843
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1028
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 441</span>
|
844
1029
|
|
845
1030
|
<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>
|
846
1031
|
<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>
|
@@ -920,13 +1105,13 @@
|
|
920
1105
|
<pre class="lines">
|
921
1106
|
|
922
1107
|
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
1108
|
+
432
|
1109
|
+
433
|
1110
|
+
434
|
1111
|
+
435</pre>
|
927
1112
|
</td>
|
928
1113
|
<td>
|
929
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1114
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 432</span>
|
930
1115
|
|
931
1116
|
<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>
|
932
1117
|
<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>
|
@@ -938,9 +1123,106 @@
|
|
938
1123
|
</div>
|
939
1124
|
|
940
1125
|
<div class="method_details ">
|
941
|
-
<h3 class="signature " id="
|
1126
|
+
<h3 class="signature " id="to_str-instance_method">
|
1127
|
+
|
1128
|
+
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>to_str</strong>(name = nil, colon = true)
|
1129
|
+
|
1130
|
+
|
1131
|
+
|
1132
|
+
|
1133
|
+
|
1134
|
+
</h3><div class="docstring">
|
1135
|
+
<div class="discussion">
|
1136
|
+
<p>Returns the name for this zone with DST (DST) active.</p>
|
1137
|
+
|
1138
|
+
|
1139
|
+
</div>
|
1140
|
+
</div>
|
1141
|
+
<div class="tags">
|
1142
|
+
<p class="tag_title">Parameters:</p>
|
1143
|
+
<ul class="param">
|
1144
|
+
|
1145
|
+
<li>
|
1146
|
+
|
1147
|
+
<span class='name'>name</span>
|
1148
|
+
|
1149
|
+
|
1150
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
1151
|
+
|
1152
|
+
|
1153
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1154
|
+
|
1155
|
+
|
1156
|
+
—
|
1157
|
+
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1158
|
+
</div>
|
1159
|
+
|
1160
|
+
</li>
|
1161
|
+
|
1162
|
+
<li>
|
1163
|
+
|
1164
|
+
<span class='name'>colon</span>
|
1165
|
+
|
1166
|
+
|
1167
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Cowtech::Extensions::Boolean (module)">Boolean</a></span></tt>)</span>
|
1168
|
+
|
1169
|
+
|
1170
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
1171
|
+
|
1172
|
+
|
1173
|
+
—
|
1174
|
+
<div class='inline'><p>If to put the colon in the output string.</p>
|
1175
|
+
</div>
|
1176
|
+
|
1177
|
+
</li>
|
1178
|
+
|
1179
|
+
</ul>
|
1180
|
+
|
1181
|
+
<p class="tag_title">Returns:</p>
|
1182
|
+
<ul class="return">
|
1183
|
+
|
1184
|
+
<li>
|
1185
|
+
|
1186
|
+
|
1187
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
1188
|
+
|
1189
|
+
|
1190
|
+
|
1191
|
+
—
|
1192
|
+
<div class='inline'><p>The name for this zone.</p>
|
1193
|
+
</div>
|
1194
|
+
|
1195
|
+
</li>
|
1196
|
+
|
1197
|
+
</ul>
|
1198
|
+
|
1199
|
+
</div><table class="source_code">
|
1200
|
+
<tr>
|
1201
|
+
<td>
|
1202
|
+
<pre class="lines">
|
1203
|
+
|
1204
|
+
|
1205
|
+
500
|
1206
|
+
501
|
1207
|
+
502
|
1208
|
+
503</pre>
|
1209
|
+
</td>
|
1210
|
+
<td>
|
1211
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 500</span>
|
1212
|
+
|
1213
|
+
<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>
|
1214
|
+
<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_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1215
|
+
<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>
|
1216
|
+
<span class='kw'>end</span></pre>
|
1217
|
+
</td>
|
1218
|
+
</tr>
|
1219
|
+
</table>
|
1220
|
+
</div>
|
1221
|
+
|
1222
|
+
<div class="method_details ">
|
1223
|
+
<h3 class="signature " id="to_str_parameterized-instance_method">
|
942
1224
|
|
943
|
-
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>
|
1225
|
+
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>to_str_parameterized</strong>(with_offset = true, name = nil)
|
944
1226
|
|
945
1227
|
|
946
1228
|
|
@@ -974,6 +1256,23 @@
|
|
974
1256
|
|
975
1257
|
</li>
|
976
1258
|
|
1259
|
+
<li>
|
1260
|
+
|
1261
|
+
<span class='name'>name</span>
|
1262
|
+
|
1263
|
+
|
1264
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
1265
|
+
|
1266
|
+
|
1267
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1268
|
+
|
1269
|
+
|
1270
|
+
—
|
1271
|
+
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1272
|
+
</div>
|
1273
|
+
|
1274
|
+
</li>
|
1275
|
+
|
977
1276
|
</ul>
|
978
1277
|
|
979
1278
|
<p class="tag_title">Returns:</p>
|
@@ -1000,15 +1299,15 @@
|
|
1000
1299
|
<pre class="lines">
|
1001
1300
|
|
1002
1301
|
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1302
|
+
529
|
1303
|
+
530
|
1304
|
+
531</pre>
|
1006
1305
|
</td>
|
1007
1306
|
<td>
|
1008
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1307
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 529</span>
|
1009
1308
|
|
1010
|
-
<span class='kw'>def</span> <span class='id identifier
|
1011
|
-
<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='kw'>self</span><span class='period'>.</span><span class='id identifier
|
1309
|
+
<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>
|
1310
|
+
<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>
|
1012
1311
|
<span class='kw'>end</span></pre>
|
1013
1312
|
</td>
|
1014
1313
|
</tr>
|
@@ -1016,9 +1315,9 @@
|
|
1016
1315
|
</div>
|
1017
1316
|
|
1018
1317
|
<div class="method_details ">
|
1019
|
-
<h3 class="signature " id="
|
1318
|
+
<h3 class="signature " id="to_str_with_dst-instance_method">
|
1020
1319
|
|
1021
|
-
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>
|
1320
|
+
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>to_str_with_dst</strong>(dst_label = nil, year = nil, name = nil)
|
1022
1321
|
|
1023
1322
|
|
1024
1323
|
|
@@ -1026,7 +1325,7 @@
|
|
1026
1325
|
|
1027
1326
|
</h3><div class="docstring">
|
1028
1327
|
<div class="discussion">
|
1029
|
-
<p>Returns a string representation for this zone with DST (
|
1328
|
+
<p>Returns a string representation for this zone with DST (DST) active.</p>
|
1030
1329
|
|
1031
1330
|
|
1032
1331
|
</div>
|
@@ -1047,7 +1346,7 @@
|
|
1047
1346
|
|
1048
1347
|
|
1049
1348
|
—
|
1050
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
1349
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
1051
1350
|
</div>
|
1052
1351
|
|
1053
1352
|
</li>
|
@@ -1069,6 +1368,23 @@
|
|
1069
1368
|
|
1070
1369
|
</li>
|
1071
1370
|
|
1371
|
+
<li>
|
1372
|
+
|
1373
|
+
<span class='name'>name</span>
|
1374
|
+
|
1375
|
+
|
1376
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
1377
|
+
|
1378
|
+
|
1379
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1380
|
+
|
1381
|
+
|
1382
|
+
—
|
1383
|
+
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1384
|
+
</div>
|
1385
|
+
|
1386
|
+
</li>
|
1387
|
+
|
1072
1388
|
</ul>
|
1073
1389
|
|
1074
1390
|
<p class="tag_title">Returns:</p>
|
@@ -1095,23 +1411,25 @@
|
|
1095
1411
|
<pre class="lines">
|
1096
1412
|
|
1097
1413
|
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1414
|
+
511
|
1415
|
+
512
|
1416
|
+
513
|
1417
|
+
514
|
1418
|
+
515
|
1419
|
+
516
|
1420
|
+
517
|
1421
|
+
518
|
1422
|
+
519
|
1423
|
+
520
|
1424
|
+
521
|
1425
|
+
522</pre>
|
1109
1426
|
</td>
|
1110
1427
|
<td>
|
1111
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1428
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 511</span>
|
1112
1429
|
|
1113
|
-
<span class='kw'>def</span> <span class='id identifier
|
1114
|
-
<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'>(
|
1430
|
+
<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>
|
1431
|
+
<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>
|
1432
|
+
<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_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1115
1433
|
|
1116
1434
|
<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>
|
1117
1435
|
<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>
|
@@ -1127,9 +1445,9 @@
|
|
1127
1445
|
</div>
|
1128
1446
|
|
1129
1447
|
<div class="method_details ">
|
1130
|
-
<h3 class="signature " id="
|
1448
|
+
<h3 class="signature " id="to_str_with_dst_parameterized-instance_method">
|
1131
1449
|
|
1132
|
-
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>
|
1450
|
+
- (<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>) <strong>to_str_with_dst_parameterized</strong>(dst_label = nil, with_offset = true, year = nil, name = nil)
|
1133
1451
|
|
1134
1452
|
|
1135
1453
|
|
@@ -1137,7 +1455,7 @@
|
|
1137
1455
|
|
1138
1456
|
</h3><div class="docstring">
|
1139
1457
|
<div class="discussion">
|
1140
|
-
<p>Returns a parametized string representation for this zone with DST (
|
1458
|
+
<p>Returns a parametized string representation for this zone with DST (DST) active.</p>
|
1141
1459
|
|
1142
1460
|
|
1143
1461
|
</div>
|
@@ -1158,7 +1476,7 @@
|
|
1158
1476
|
|
1159
1477
|
|
1160
1478
|
—
|
1161
|
-
<div class='inline'><p>Label for the DST indication. Defaults to <code>(
|
1479
|
+
<div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
|
1162
1480
|
</div>
|
1163
1481
|
|
1164
1482
|
</li>
|
@@ -1197,6 +1515,23 @@
|
|
1197
1515
|
|
1198
1516
|
</li>
|
1199
1517
|
|
1518
|
+
<li>
|
1519
|
+
|
1520
|
+
<span class='name'>name</span>
|
1521
|
+
|
1522
|
+
|
1523
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="Cowtech::Extensions::String (module)">String</a></span></tt>)</span>
|
1524
|
+
|
1525
|
+
|
1526
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1527
|
+
|
1528
|
+
|
1529
|
+
—
|
1530
|
+
<div class='inline'><p>The name to use for this zone. Defaults to the zone name.</p>
|
1531
|
+
</div>
|
1532
|
+
|
1533
|
+
</li>
|
1534
|
+
|
1200
1535
|
</ul>
|
1201
1536
|
|
1202
1537
|
<p class="tag_title">Returns:</p>
|
@@ -1223,16 +1558,16 @@
|
|
1223
1558
|
<pre class="lines">
|
1224
1559
|
|
1225
1560
|
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1561
|
+
540
|
1562
|
+
541
|
1563
|
+
542
|
1564
|
+
543</pre>
|
1230
1565
|
</td>
|
1231
1566
|
<td>
|
1232
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1567
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 540</span>
|
1233
1568
|
|
1234
|
-
<span class='kw'>def</span> <span class='id identifier
|
1235
|
-
<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
|
1569
|
+
<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>
|
1570
|
+
<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>
|
1236
1571
|
<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>
|
1237
1572
|
<span class='kw'>end</span></pre>
|
1238
1573
|
</td>
|
@@ -1251,7 +1586,7 @@
|
|
1251
1586
|
|
1252
1587
|
</h3><div class="docstring">
|
1253
1588
|
<div class="discussion">
|
1254
|
-
<p>Checks if the timezone uses DST (
|
1589
|
+
<p>Checks if the timezone uses DST (DST) for that year.</p>
|
1255
1590
|
|
1256
1591
|
|
1257
1592
|
</div>
|
@@ -1303,12 +1638,12 @@
|
|
1303
1638
|
<pre class="lines">
|
1304
1639
|
|
1305
1640
|
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1641
|
+
456
|
1642
|
+
457
|
1643
|
+
458</pre>
|
1309
1644
|
</td>
|
1310
1645
|
<td>
|
1311
|
-
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line
|
1646
|
+
<pre class="code"><span class="info file"># File 'lib/cowtech-extensions/datetime.rb', line 456</span>
|
1312
1647
|
|
1313
1648
|
<span class='kw'>def</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='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1314
1649
|
<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><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
@@ -1323,7 +1658,7 @@
|
|
1323
1658
|
</div>
|
1324
1659
|
|
1325
1660
|
<div id="footer">
|
1326
|
-
Generated on
|
1661
|
+
Generated on Tue Jul 24 12:12:52 2012 by
|
1327
1662
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1328
1663
|
0.8.2.1 (ruby-1.9.2).
|
1329
1664
|
</div>
|