lazier 1.0.7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/README.md +5 -2
- data/doc/Lazier.html +472 -174
- data/doc/Lazier/Boolean.html +9 -11
- data/doc/Lazier/DateTime.html +59 -113
- data/doc/Lazier/DateTime/ClassMethods.html +87 -121
- data/doc/Lazier/Exceptions.html +3 -3
- data/doc/Lazier/Exceptions/Dump.html +3 -3
- data/doc/Lazier/Hash.html +17 -19
- data/doc/Lazier/Math.html +3 -3
- data/doc/Lazier/Math/ClassMethods.html +14 -48
- data/doc/Lazier/Object.html +127 -139
- data/doc/Lazier/Pathname.html +11 -12
- data/doc/Lazier/Settings.html +189 -169
- data/doc/Lazier/String.html +23 -27
- data/doc/Lazier/TimeZone.html +202 -249
- data/doc/Lazier/TimeZone/ClassMethods.html +110 -137
- data/doc/Lazier/Version.html +7 -11
- data/doc/_index.html +4 -4
- data/doc/file.README.html +12 -9
- data/doc/frames.html +1 -1
- data/doc/index.html +12 -9
- data/doc/method_list.html +72 -24
- data/doc/top-level-namespace.html +3 -3
- data/lazier.gemspec +8 -8
- data/lib/lazier.rb +55 -59
- data/lib/lazier/datetime.rb +74 -88
- data/lib/lazier/math.rb +2 -18
- data/lib/lazier/object.rb +14 -13
- data/lib/lazier/settings.rb +8 -25
- data/lib/lazier/version.rb +2 -2
- data/spec/lazier/datetime_spec.rb +12 -20
- data/spec/lazier/hash_spec.rb +1 -1
- data/spec/lazier/object_spec.rb +3 -3
- data/spec/lazier/settings_spec.rb +3 -3
- data/spec/lazier_spec.rb +1 -19
- metadata +145 -160
data/doc/Lazier/Boolean.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::Boolean
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -218,10 +218,9 @@
|
|
218
218
|
<td>
|
219
219
|
<pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 15</span>
|
220
220
|
|
221
|
-
<span class='
|
222
|
-
<span class='lparen
|
223
|
-
<span class='
|
224
|
-
</pre>
|
221
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
|
222
|
+
<span class='lparen'>(</span><span class='kw'>self</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span>
|
223
|
+
<span class='kw'>end</span></pre>
|
225
224
|
</td>
|
226
225
|
</tr>
|
227
226
|
</table>
|
@@ -276,10 +275,9 @@
|
|
276
275
|
<td>
|
277
276
|
<pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 22</span>
|
278
277
|
|
279
|
-
<span class='
|
280
|
-
<span class='
|
281
|
-
<span class='
|
282
|
-
</pre>
|
278
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
|
279
|
+
<span class='kw'>self</span>
|
280
|
+
<span class='kw'>end</span></pre>
|
283
281
|
</td>
|
284
282
|
</tr>
|
285
283
|
</table>
|
@@ -290,9 +288,9 @@
|
|
290
288
|
</div>
|
291
289
|
|
292
290
|
<div id="footer">
|
293
|
-
Generated on
|
291
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
294
292
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
295
|
-
0.8.
|
293
|
+
0.8.3 (ruby-1.9.3).
|
296
294
|
</div>
|
297
295
|
|
298
296
|
</body>
|
data/doc/Lazier/DateTime.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::DateTime
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -284,9 +284,9 @@
|
|
284
284
|
<div class="discussion">
|
285
285
|
<p>Returns the number of months passed between the beginning of the base year and the current date.</p>
|
286
286
|
|
287
|
-
<pre class="code ruby"><code><span class='
|
288
|
-
<span class='comment
|
289
|
-
</code></pre>
|
287
|
+
<pre class="code ruby"><code><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_civil'>civil</span><span class='lparen'>(</span><span class='int'>2013</span><span class='comma'>,</span> <span class='int'>6</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_months'>in_months</span><span class='lparen'>(</span><span class='int'>2011</span><span class='rparen'>)</span>
|
288
|
+
<span class='comment'># => 18
|
289
|
+
</span></code></pre>
|
290
290
|
|
291
291
|
|
292
292
|
</div>
|
@@ -338,19 +338,18 @@
|
|
338
338
|
<pre class="lines">
|
339
339
|
|
340
340
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
341
|
+
229
|
342
|
+
230
|
343
|
+
231
|
344
|
+
232</pre>
|
345
345
|
</td>
|
346
346
|
<td>
|
347
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
347
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 229</span>
|
348
348
|
|
349
|
-
<span class='
|
350
|
-
<span class='
|
351
|
-
<span class='lparen
|
352
|
-
<span class='
|
353
|
-
</pre>
|
349
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_in_months'>in_months</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
350
|
+
<span class='id identifier rubyid_base'>base</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>
|
351
|
+
<span class='lparen'>(</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='int'>12</span> <span class='op'>+</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span>
|
352
|
+
<span class='kw'>end</span></pre>
|
354
353
|
</td>
|
355
354
|
</tr>
|
356
355
|
</table>
|
@@ -426,17 +425,16 @@
|
|
426
425
|
<pre class="lines">
|
427
426
|
|
428
427
|
|
429
|
-
|
430
|
-
|
431
|
-
|
428
|
+
266
|
429
|
+
267
|
430
|
+
268</pre>
|
432
431
|
</td>
|
433
432
|
<td>
|
434
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
433
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 266</span>
|
435
434
|
|
436
|
-
<span class='
|
437
|
-
<span class='lparen
|
438
|
-
<span class='
|
439
|
-
</pre>
|
435
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_local_lstrftime'>local_lstrftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
436
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:in_time_zone</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_time_zone'>in_time_zone</span> <span class='op'>:</span> <span class='kw'>self</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_lstrftime'>lstrftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
437
|
+
<span class='kw'>end</span></pre>
|
440
438
|
</td>
|
441
439
|
</tr>
|
442
440
|
</table>
|
@@ -505,17 +503,16 @@
|
|
505
503
|
<pre class="lines">
|
506
504
|
|
507
505
|
|
508
|
-
|
509
|
-
|
510
|
-
|
506
|
+
257
|
507
|
+
258
|
508
|
+
259</pre>
|
511
509
|
</td>
|
512
510
|
<td>
|
513
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
511
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 257</span>
|
514
512
|
|
515
|
-
<span class='
|
516
|
-
<span class='lparen
|
517
|
-
<span class='
|
518
|
-
</pre>
|
513
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_local_strftime'>local_strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
514
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:in_time_zone</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_time_zone'>in_time_zone</span> <span class='op'>:</span> <span class='kw'>self</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
515
|
+
<span class='kw'>end</span></pre>
|
519
516
|
</td>
|
520
517
|
</tr>
|
521
518
|
</table>
|
@@ -591,71 +588,22 @@
|
|
591
588
|
<pre class="lines">
|
592
589
|
|
593
590
|
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
216
|
601
|
-
217
|
602
|
-
218
|
603
|
-
219
|
604
|
-
220
|
605
|
-
221
|
606
|
-
222
|
607
|
-
223
|
608
|
-
224
|
609
|
-
225
|
610
|
-
226
|
611
|
-
227
|
612
|
-
228
|
613
|
-
229
|
614
|
-
230
|
615
|
-
231
|
616
|
-
232
|
617
|
-
233
|
618
|
-
234
|
619
|
-
235
|
620
|
-
236
|
621
|
-
237
|
622
|
-
238
|
623
|
-
239</pre>
|
591
|
+
246
|
592
|
+
247
|
593
|
+
248
|
594
|
+
249
|
595
|
+
250
|
596
|
+
251</pre>
|
624
597
|
</td>
|
625
598
|
<td>
|
626
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
627
|
-
|
628
|
-
<span class='
|
629
|
-
<span class='
|
630
|
-
<span class='
|
631
|
-
|
632
|
-
<span class='
|
633
|
-
|
634
|
-
|
635
|
-
<span class='comment val'># Handling of %z is to fix ruby 1.8 bug in OSX: http://bugs.ruby-lang.org/issues/2396</span>
|
636
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_match identifier id'>match</span> <span class='nmatch op'>!~</span> <span class='regexp val'>/^%%/</span> <span class='rubyid_then then kw'>then</span>
|
637
|
-
<span class='rubyid_case case kw'>case</span> <span class='rubyid_match identifier id'>match</span>
|
638
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%a"</span>
|
639
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:short_days</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_wday identifier id'>wday</span><span class='rbrack token'>]</span>
|
640
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%A"</span>
|
641
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:long_days</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_wday identifier id'>wday</span><span class='rbrack token'>]</span>
|
642
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%b"</span>
|
643
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:short_months</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span>
|
644
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%B"</span>
|
645
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='rubyid_names identifier id'>names</span><span class='lbrack token'>[</span><span class='symbol val'>:long_months</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_month identifier id'>month</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span>
|
646
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%z"</span>
|
647
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_is_ruby_18? fid id'>is_ruby_18?</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_formatted_offset identifier id'>formatted_offset</span><span class='lparen token'>(</span><span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
648
|
-
<span class='rubyid_when when kw'>when</span> <span class='string val'>"%:z"</span>
|
649
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='assign token'>=</span> <span class='colon3 op'>::</span><span class='rubyid_Lazier constant id'>Lazier</span><span class='dot token'>.</span><span class='rubyid_is_ruby_18? fid id'>is_ruby_18?</span> <span class='integer val'>? </span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_formatted_offset identifier id'>formatted_offset</span><span class='lparen token'>(</span><span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
650
|
-
<span class='rubyid_end end kw'>end</span>
|
651
|
-
<span class='rubyid_end end kw'>end</span>
|
652
|
-
|
653
|
-
<span class='rubyid_mrv identifier id'>mrv</span> <span class='integer val'>? </span><span class='rubyid_mrv identifier id'>mrv</span><span class='dot token'>.</span><span class='rubyid_sub identifier id'>sub</span><span class='lparen token'>(</span><span class='string val'>"%"</span><span class='comma token'>,</span> <span class='string val'>"%%"</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_match identifier id'>match</span>
|
654
|
-
<span class='rubyid_end end kw'>end</span>
|
655
|
-
|
656
|
-
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_strftime identifier id'>strftime</span><span class='lparen token'>(</span><span class='rubyid_final_format identifier id'>final_format</span><span class='rparen token'>)</span>
|
657
|
-
<span class='rubyid_end end kw'>end</span>
|
658
|
-
</pre>
|
599
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 246</span>
|
600
|
+
|
601
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_lstrftime'>lstrftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
602
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
603
|
+
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_date_names'>date_names</span>
|
604
|
+
<span class='id identifier rubyid_substitutions'>substitutions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%a</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:short_days</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wday'>wday</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%A</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:long_days</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wday'>wday</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%b</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:short_months</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%B</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:long_months</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
605
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</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'>(?<!%)(%[ab])</span><span class='regexp_end'>/i</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_mo'>mo</span><span class='op'>|</span> <span class='id identifier rubyid_substitutions'>substitutions</span><span class='lbracket'>[</span><span class='id identifier rubyid_mo'>mo</span><span class='rbracket'>]</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
606
|
+
<span class='kw'>end</span></pre>
|
659
607
|
</td>
|
660
608
|
</tr>
|
661
609
|
</table>
|
@@ -703,17 +651,16 @@
|
|
703
651
|
<pre class="lines">
|
704
652
|
|
705
653
|
|
706
|
-
|
707
|
-
|
708
|
-
|
654
|
+
237
|
655
|
+
238
|
656
|
+
239</pre>
|
709
657
|
</td>
|
710
658
|
<td>
|
711
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 237</span>
|
712
660
|
|
713
|
-
<span class='
|
714
|
-
<span class='
|
715
|
-
<span class='
|
716
|
-
</pre>
|
661
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_padded_month'>padded_month</span>
|
662
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
663
|
+
<span class='kw'>end</span></pre>
|
717
664
|
</td>
|
718
665
|
</tr>
|
719
666
|
</table>
|
@@ -761,19 +708,18 @@
|
|
761
708
|
<pre class="lines">
|
762
709
|
|
763
710
|
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
711
|
+
215
|
712
|
+
216
|
713
|
+
217
|
714
|
+
218</pre>
|
768
715
|
</td>
|
769
716
|
<td>
|
770
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
717
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 215</span>
|
771
718
|
|
772
|
-
<span class='
|
773
|
-
<span class='
|
774
|
-
<span class='
|
775
|
-
<span class='
|
776
|
-
</pre>
|
719
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_utc_time'>utc_time</span>
|
720
|
+
<span class='id identifier rubyid_ua'>ua</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:utc</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_datetime'>to_datetime</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span>
|
721
|
+
<span class='op'>::</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='lparen'>(</span><span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_hour'>hour</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_sec'>sec</span><span class='rparen'>)</span>
|
722
|
+
<span class='kw'>end</span></pre>
|
777
723
|
</td>
|
778
724
|
</tr>
|
779
725
|
</table>
|
@@ -784,9 +730,9 @@
|
|
784
730
|
</div>
|
785
731
|
|
786
732
|
<div id="footer">
|
787
|
-
Generated on
|
733
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
788
734
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
789
|
-
0.8.
|
735
|
+
0.8.3 (ruby-1.9.3).
|
790
736
|
</div>
|
791
737
|
|
792
738
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::DateTime::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -462,17 +462,16 @@
|
|
462
462
|
<pre class="lines">
|
463
463
|
|
464
464
|
|
465
|
-
|
466
|
-
|
467
|
-
|
465
|
+
140
|
466
|
+
141
|
467
|
+
142</pre>
|
468
468
|
</td>
|
469
469
|
<td>
|
470
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
470
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 140</span>
|
471
471
|
|
472
|
-
<span class='
|
473
|
-
<span class='
|
474
|
-
<span class='
|
475
|
-
</pre>
|
472
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
473
|
+
<span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_date_formats'>date_formats</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
474
|
+
<span class='kw'>end</span></pre>
|
476
475
|
</td>
|
477
476
|
</tr>
|
478
477
|
</table>
|
@@ -559,14 +558,13 @@
|
|
559
558
|
<td>
|
560
559
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 19</span>
|
561
560
|
|
562
|
-
<span class='
|
563
|
-
<span class='
|
564
|
-
<span class='lparen
|
565
|
-
<span class='lbrace
|
566
|
-
<span class='rbrace
|
561
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_days'>days</span><span class='lparen'>(</span><span class='id identifier rubyid_short'>short</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
562
|
+
<span class='id identifier rubyid_days'>days</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_date_names'>date_names</span><span class='lbracket'>[</span><span class='id identifier rubyid_short'>short</span> <span class='op'>?</span> <span class='symbol'>:short_days</span> <span class='op'>:</span> <span class='symbol'>:long_days</span><span class='rbracket'>]</span>
|
563
|
+
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>7</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
564
|
+
<span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='id identifier rubyid_days'>days</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
565
|
+
<span class='rbrace'>}</span>
|
567
566
|
|
568
|
-
<span class='
|
569
|
-
</pre>
|
567
|
+
<span class='kw'>end</span></pre>
|
570
568
|
</td>
|
571
569
|
</tr>
|
572
570
|
</table>
|
@@ -651,44 +649,21 @@
|
|
651
649
|
130
|
652
650
|
131
|
653
651
|
132
|
654
|
-
133
|
655
|
-
134
|
656
|
-
135
|
657
|
-
136
|
658
|
-
137
|
659
|
-
138
|
660
|
-
139
|
661
|
-
140
|
662
|
-
141
|
663
|
-
142
|
664
|
-
143
|
665
|
-
144</pre>
|
652
|
+
133</pre>
|
666
653
|
</td>
|
667
654
|
<td>
|
668
655
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 124</span>
|
669
656
|
|
670
|
-
<span class='
|
671
|
-
<span class='
|
672
|
-
|
673
|
-
<span class='comment
|
674
|
-
<span class='
|
675
|
-
<span class='
|
676
|
-
<span class='
|
677
|
-
|
678
|
-
<span class='
|
679
|
-
|
680
|
-
<span class='rubyid_g identifier id'>g</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_b identifier id'>b</span> <span class='minus op'>-</span> <span class='rubyid_f identifier id'>f</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>3.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
681
|
-
<span class='rubyid_h identifier id'>h</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='integer val'>19</span> <span class='mult op'>*</span> <span class='rubyid_a identifier id'>a</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='rubyid_b identifier id'>b</span> <span class='minus op'>-</span> <span class='rubyid_d identifier id'>d</span> <span class='minus op'>-</span> <span class='rubyid_g identifier id'>g</span> <span class='plus op'>+</span> <span class='integer val'>15</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>30</span>
|
682
|
-
<span class='rubyid_i identifier id'>i</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_c identifier id'>c</span> <span class='div op'>/</span> <span class='float val'>4.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
683
|
-
<span class='rubyid_k identifier id'>k</span> <span class='assign token'>=</span> <span class='rubyid_c identifier id'>c</span> <span class='mod op'>%</span> <span class='integer val'>4</span>
|
684
|
-
<span class='rubyid_l identifier id'>l</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='integer val'>32</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>2</span> <span class='mult op'>*</span> <span class='rubyid_e identifier id'>e</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>2</span> <span class='mult op'>*</span> <span class='rubyid_i identifier id'>i</span><span class='rparen token'>)</span> <span class='minus op'>-</span> <span class='rubyid_h identifier id'>h</span> <span class='minus op'>-</span> <span class='rubyid_k identifier id'>k</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>7</span>
|
685
|
-
<span class='rubyid_m identifier id'>m</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_a identifier id'>a</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>11</span> <span class='mult op'>*</span> <span class='rubyid_h identifier id'>h</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='lparen token'>(</span><span class='integer val'>22</span> <span class='mult op'>*</span> <span class='rubyid_l identifier id'>l</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>451.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
686
|
-
|
687
|
-
<span class='rubyid_day identifier id'>day</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_h identifier id'>h</span> <span class='plus op'>+</span> <span class='rubyid_l identifier id'>l</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='integer val'>7</span> <span class='mult op'>*</span> <span class='rubyid_m identifier id'>m</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>114</span><span class='rparen token'>)</span> <span class='mod op'>%</span> <span class='integer val'>31</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
|
688
|
-
<span class='rubyid_month identifier id'>month</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='lparen token'>(</span><span class='rubyid_h identifier id'>h</span> <span class='plus op'>+</span> <span class='rubyid_l identifier id'>l</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='integer val'>7</span> <span class='mult op'>*</span> <span class='rubyid_m identifier id'>m</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='integer val'>114</span><span class='rparen token'>)</span> <span class='div op'>/</span> <span class='float val'>31.0</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_floor identifier id'>floor</span>
|
689
|
-
<span class='colon3 op'>::</span><span class='rubyid_Date constant id'>Date</span><span class='dot token'>.</span><span class='rubyid_civil identifier id'>civil</span><span class='lparen token'>(</span><span class='rubyid_year identifier id'>year</span><span class='comma token'>,</span> <span class='rubyid_month identifier id'>month</span><span class='comma token'>,</span> <span class='rubyid_day identifier id'>day</span><span class='rparen token'>)</span>
|
690
|
-
<span class='rubyid_end end kw'>end</span>
|
691
|
-
</pre>
|
657
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_easter'>easter</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>
|
658
|
+
<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> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_year'>year</span><span class='period'>.</span><span class='id identifier rubyid_is_integer?'>is_integer?</span>
|
659
|
+
|
660
|
+
<span class='comment'># Compute using Anonymouse Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm
|
661
|
+
</span> <span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='comma'>,</span> <span class='id identifier rubyid_c'>c</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_independent'>easter_independent</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
|
662
|
+
<span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='comma'>,</span> <span class='id identifier rubyid_k'>k</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_dependent'>easter_dependent</span><span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span><span class='comma'>,</span> <span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span>
|
663
|
+
<span class='id identifier rubyid_day'>day</span><span class='comma'>,</span> <span class='id identifier rubyid_month'>month</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_summarize'>easter_summarize</span><span class='lparen'>(</span><span class='id identifier rubyid_easter_finalize'>easter_finalize</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='comma'>,</span> <span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
664
|
+
|
665
|
+
<span class='op'>::</span><span class='const'>Date</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='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
|
666
|
+
<span class='kw'>end</span></pre>
|
692
667
|
</td>
|
693
668
|
</tr>
|
694
669
|
</table>
|
@@ -781,10 +756,9 @@
|
|
781
756
|
<td>
|
782
757
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 83</span>
|
783
758
|
|
784
|
-
<span class='
|
785
|
-
<span class='
|
786
|
-
<span class='
|
787
|
-
</pre>
|
759
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_timezone'>find_timezone</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
760
|
+
<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_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span>
|
761
|
+
<span class='kw'>end</span></pre>
|
788
762
|
</td>
|
789
763
|
</tr>
|
790
764
|
</table>
|
@@ -875,37 +849,36 @@
|
|
875
849
|
<pre class="lines">
|
876
850
|
|
877
851
|
|
852
|
+
150
|
853
|
+
151
|
854
|
+
152
|
855
|
+
153
|
856
|
+
154
|
857
|
+
155
|
858
|
+
156
|
859
|
+
157
|
860
|
+
158
|
861
|
+
159
|
862
|
+
160
|
878
863
|
161
|
879
|
-
162
|
880
|
-
163
|
881
|
-
164
|
882
|
-
165
|
883
|
-
166
|
884
|
-
167
|
885
|
-
168
|
886
|
-
169
|
887
|
-
170
|
888
|
-
171
|
889
|
-
172
|
890
|
-
173</pre>
|
864
|
+
162</pre>
|
891
865
|
</td>
|
892
866
|
<td>
|
893
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
867
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 150</span>
|
894
868
|
|
895
|
-
<span class='
|
896
|
-
<span class='
|
869
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_valid?'>is_valid?</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
870
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>true</span>
|
897
871
|
|
898
|
-
<span class='
|
872
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
899
873
|
|
900
|
-
<span class='
|
901
|
-
<span class='
|
902
|
-
<span class='
|
903
|
-
<span class='
|
904
|
-
<span class='
|
874
|
+
<span class='kw'>begin</span>
|
875
|
+
<span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_strptime'>strptime</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
876
|
+
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
877
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>false</span>
|
878
|
+
<span class='kw'>end</span>
|
905
879
|
|
906
|
-
<span class='
|
907
|
-
<span class='
|
908
|
-
</pre>
|
880
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
881
|
+
<span class='kw'>end</span></pre>
|
909
882
|
</td>
|
910
883
|
</tr>
|
911
884
|
</table>
|
@@ -998,10 +971,9 @@
|
|
998
971
|
<td>
|
999
972
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 74</span>
|
1000
973
|
|
1001
|
-
<span class='
|
1002
|
-
<span class='
|
1003
|
-
<span class='
|
1004
|
-
</pre>
|
974
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_list_timezones'>list_timezones</span><span class='lparen'>(</span><span class='id identifier rubyid_with_dst'>with_dst</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
975
|
+
<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_list_all'>list_all</span><span class='lparen'>(</span><span class='id identifier rubyid_with_dst'>with_dst</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span>
|
976
|
+
<span class='kw'>end</span></pre>
|
1005
977
|
</td>
|
1006
978
|
</tr>
|
1007
979
|
</table>
|
@@ -1087,13 +1059,12 @@
|
|
1087
1059
|
<td>
|
1088
1060
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 32</span>
|
1089
1061
|
|
1090
|
-
<span class='
|
1091
|
-
<span class='
|
1092
|
-
<span class='lparen
|
1093
|
-
<span class='lbrace
|
1094
|
-
<span class='rbrace
|
1095
|
-
<span class='
|
1096
|
-
</pre>
|
1062
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_months'>months</span><span class='lparen'>(</span><span class='id identifier rubyid_short'>short</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
1063
|
+
<span class='id identifier rubyid_months'>months</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_date_names'>date_names</span><span class='lbracket'>[</span><span class='id identifier rubyid_short'>short</span> <span class='op'>?</span> <span class='symbol'>:short_months</span> <span class='op'>:</span> <span class='symbol'>:long_months</span><span class='rbracket'>]</span>
|
1064
|
+
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>12</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
1065
|
+
<span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='id identifier rubyid_months'>months</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1066
|
+
<span class='rbrace'>}</span>
|
1067
|
+
<span class='kw'>end</span></pre>
|
1097
1068
|
</td>
|
1098
1069
|
</tr>
|
1099
1070
|
</table>
|
@@ -1112,9 +1083,9 @@
|
|
1112
1083
|
<div class="discussion">
|
1113
1084
|
<p>Returns a string representation of a timezone.</p>
|
1114
1085
|
|
1115
|
-
<pre class="code ruby"><code><span class='
|
1116
|
-
<span class='comment
|
1117
|
-
</code></pre>
|
1086
|
+
<pre class="code ruby"><code><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Pacific Time (US & Canada)</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1087
|
+
<span class='comment'># => "-0800@pacific-time-us-canada"
|
1088
|
+
</span></code></pre>
|
1118
1089
|
|
1119
1090
|
|
1120
1091
|
</div>
|
@@ -1188,10 +1159,9 @@
|
|
1188
1159
|
<td>
|
1189
1160
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 96</span>
|
1190
1161
|
|
1191
|
-
<span class='
|
1192
|
-
<span class='
|
1193
|
-
<span class='
|
1194
|
-
</pre>
|
1162
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</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='rparen'>)</span>
|
1163
|
+
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='op'>::</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='rparen'>)</span>
|
1164
|
+
<span class='kw'>end</span></pre>
|
1195
1165
|
</td>
|
1196
1166
|
</tr>
|
1197
1167
|
</table>
|
@@ -1265,10 +1235,9 @@
|
|
1265
1235
|
<td>
|
1266
1236
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 115</span>
|
1267
1237
|
|
1268
|
-
<span class='
|
1269
|
-
<span class='
|
1270
|
-
<span class='
|
1271
|
-
</pre>
|
1238
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span>
|
1239
|
+
<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_rationalize_offset'>rationalize_offset</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span><span class='rparen'>)</span>
|
1240
|
+
<span class='kw'>end</span></pre>
|
1272
1241
|
</td>
|
1273
1242
|
</tr>
|
1274
1243
|
</table>
|
@@ -1323,10 +1292,9 @@
|
|
1323
1292
|
<td>
|
1324
1293
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 65</span>
|
1325
1294
|
|
1326
|
-
<span class='
|
1327
|
-
<span class='
|
1328
|
-
<span class='
|
1329
|
-
</pre>
|
1295
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_timezones'>timezones</span>
|
1296
|
+
<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_all'>all</span>
|
1297
|
+
<span class='kw'>end</span></pre>
|
1330
1298
|
</td>
|
1331
1299
|
</tr>
|
1332
1300
|
</table>
|
@@ -1441,10 +1409,9 @@
|
|
1441
1409
|
<td>
|
1442
1410
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 107</span>
|
1443
1411
|
|
1444
|
-
<span class='
|
1445
|
-
<span class='
|
1446
|
-
<span class='
|
1447
|
-
</pre>
|
1412
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unparameterize_zone'>unparameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_as_string'>as_string</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1413
|
+
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='op'>::</span><span class='id identifier rubyid_unparameterize_zone'>unparameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_as_string'>as_string</span><span class='comma'>,</span> <span class='id identifier rubyid_dst_label'>dst_label</span><span class='rparen'>)</span>
|
1414
|
+
<span class='kw'>end</span></pre>
|
1448
1415
|
</td>
|
1449
1416
|
</tr>
|
1450
1417
|
</table>
|
@@ -1463,13 +1430,13 @@
|
|
1463
1430
|
<div class="discussion">
|
1464
1431
|
<p>Returns a range of years.</p>
|
1465
1432
|
|
1466
|
-
<pre class="code ruby"><code><span class='
|
1467
|
-
<span class='comment
|
1468
|
-
</code></pre>
|
1433
|
+
<pre class="code ruby"><code><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_years'>years</span><span class='lparen'>(</span><span class='int'>3</span><span class='comma'>,</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='int'>2010</span><span class='rparen'>)</span>
|
1434
|
+
<span class='comment'># => [2007, 2008, 2009, 2010]
|
1435
|
+
</span></code></pre>
|
1469
1436
|
|
1470
|
-
<pre class="code ruby"><code><span class='
|
1471
|
-
<span class='comment
|
1472
|
-
</code></pre>
|
1437
|
+
<pre class="code ruby"><code><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_years'>years</span><span class='lparen'>(</span><span class='int'>1</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='int'>2010</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
1438
|
+
<span class='comment'># => [{:value=>2009, :label=>2009}, {:value=>2010, :label=>2010}, {:value=>2011, :label=>2011}]
|
1439
|
+
</span></code></pre>
|
1473
1440
|
|
1474
1441
|
|
1475
1442
|
</div>
|
@@ -1580,11 +1547,10 @@
|
|
1580
1547
|
<td>
|
1581
1548
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 57</span>
|
1582
1549
|
|
1583
|
-
<span class='
|
1584
|
-
<span class='
|
1585
|
-
<span class='lparen
|
1586
|
-
<span class='
|
1587
|
-
</pre>
|
1550
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_years'>years</span><span class='lparen'>(</span><span class='id identifier rubyid_offset'>offset</span> <span class='op'>=</span> <span class='int'>10</span><span class='comma'>,</span> <span class='id identifier rubyid_also_future'>also_future</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_reference'>reference</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_as_objects'>as_objects</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
1551
|
+
<span class='id identifier rubyid_y'>y</span> <span class='op'>=</span> <span class='id identifier rubyid_reference'>reference</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>
|
1552
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_y'>y</span> <span class='op'>-</span> <span class='id identifier rubyid_offset'>offset</span><span class='op'>..</span><span class='lparen'>(</span><span class='id identifier rubyid_also_future'>also_future</span> <span class='op'>?</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>+</span> <span class='id identifier rubyid_offset'>offset</span> <span class='op'>:</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_year'>year</span><span class='op'>|</span> <span class='id identifier rubyid_as_objects'>as_objects</span> <span class='op'>?</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='id identifier rubyid_year'>year</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='id identifier rubyid_year'>year</span> <span class='rbrace'>}</span>
|
1553
|
+
<span class='kw'>end</span></pre>
|
1588
1554
|
</td>
|
1589
1555
|
</tr>
|
1590
1556
|
</table>
|
@@ -1595,9 +1561,9 @@
|
|
1595
1561
|
</div>
|
1596
1562
|
|
1597
1563
|
<div id="footer">
|
1598
|
-
Generated on
|
1564
|
+
Generated on Mon Jan 28 20:23:46 2013 by
|
1599
1565
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1600
|
-
0.8.
|
1566
|
+
0.8.3 (ruby-1.9.3).
|
1601
1567
|
</div>
|
1602
1568
|
|
1603
1569
|
</body>
|