lazier 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +6 -0
  2. data/.travis.yml +8 -0
  3. data/.yardopts +1 -0
  4. data/Gemfile +9 -0
  5. data/Gemfile.lock +82 -0
  6. data/README.md +33 -0
  7. data/Rakefile +18 -0
  8. data/doc/Lazier.html +557 -0
  9. data/doc/Lazier/Boolean.html +297 -0
  10. data/doc/Lazier/DateTime.html +787 -0
  11. data/doc/Lazier/DateTime/ClassMethods.html +1592 -0
  12. data/doc/Lazier/Exceptions.html +125 -0
  13. data/doc/Lazier/Exceptions/Dump.html +133 -0
  14. data/doc/Lazier/Hash.html +393 -0
  15. data/doc/Lazier/Math.html +130 -0
  16. data/doc/Lazier/Math/ClassMethods.html +362 -0
  17. data/doc/Lazier/Object.html +1565 -0
  18. data/doc/Lazier/Pathname.html +225 -0
  19. data/doc/Lazier/Settings.html +1249 -0
  20. data/doc/Lazier/String.html +471 -0
  21. data/doc/Lazier/TimeZone.html +1675 -0
  22. data/doc/Lazier/TimeZone/ClassMethods.html +1055 -0
  23. data/doc/Lazier/Version.html +189 -0
  24. data/doc/_index.html +306 -0
  25. data/doc/class_list.html +53 -0
  26. data/doc/css/common.css +1 -0
  27. data/doc/css/full_list.css +57 -0
  28. data/doc/css/style.css +328 -0
  29. data/doc/file.README.html +107 -0
  30. data/doc/file_list.html +55 -0
  31. data/doc/frames.html +28 -0
  32. data/doc/index.html +107 -0
  33. data/doc/js/app.js +214 -0
  34. data/doc/js/full_list.js +173 -0
  35. data/doc/js/jquery.js +4 -0
  36. data/doc/method_list.html +652 -0
  37. data/doc/top-level-namespace.html +112 -0
  38. data/lazier.gemspec +36 -0
  39. data/lib/lazier.rb +127 -0
  40. data/lib/lazier/boolean.rb +26 -0
  41. data/lib/lazier/datetime.rb +548 -0
  42. data/lib/lazier/exceptions.rb +14 -0
  43. data/lib/lazier/hash.rb +40 -0
  44. data/lib/lazier/math.rb +47 -0
  45. data/lib/lazier/object.rb +163 -0
  46. data/lib/lazier/pathname.rb +26 -0
  47. data/lib/lazier/settings.rb +118 -0
  48. data/lib/lazier/string.rb +54 -0
  49. data/lib/lazier/version.rb +24 -0
  50. data/spec/coverage_helper.rb +19 -0
  51. data/spec/cowtech-extensions/boolean_spec.rb +30 -0
  52. data/spec/cowtech-extensions/datetime_spec.rb +352 -0
  53. data/spec/cowtech-extensions/hash_spec.rb +30 -0
  54. data/spec/cowtech-extensions/math_spec.rb +41 -0
  55. data/spec/cowtech-extensions/object_spec.rb +231 -0
  56. data/spec/cowtech-extensions/pathname_spec.rb +21 -0
  57. data/spec/cowtech-extensions/settings_spec.rb +118 -0
  58. data/spec/cowtech-extensions/string_spec.rb +45 -0
  59. data/spec/lazier_spec.rb +57 -0
  60. data/spec/spec_helper.rb +16 -0
  61. metadata +292 -0
@@ -0,0 +1,1592 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Lazier::DateTime::ClassMethods
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Lazier.html" title="Lazier (module)">Lazier</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../DateTime.html" title="Lazier::DateTime (module)">DateTime</a></span></span>
36
+ &raquo;
37
+ <span class="title">ClassMethods</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Lazier::DateTime::ClassMethods
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/lazier/datetime.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+ <p>General methods.</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ <h2>
106
+ Instance Method Summary
107
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
108
+ </h2>
109
+
110
+ <ul class="summary">
111
+
112
+ <li class="public ">
113
+ <span class="summary_signature">
114
+
115
+ <a href="#custom_format-instance_method" title="#custom_format (instance method)">- (String) <strong>custom_format</strong>(key) </a>
116
+
117
+
118
+
119
+ </span>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'><p>Lookups a custom datetime format.</p>
130
+ </div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#days-instance_method" title="#days (instance method)">- (Array) <strong>days</strong>(short = true) </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'><p>Returns strings representations of days.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#easter-instance_method" title="#easter (instance method)">- (Date) <strong>easter</strong>(year = nil) </a>
162
+
163
+
164
+
165
+ </span>
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <span class="summary_desc"><div class='inline'><p>Returns the Easter (according to Gregorian calendar) date for the year.</p>
176
+ </div></span>
177
+
178
+ </li>
179
+
180
+
181
+ <li class="public ">
182
+ <span class="summary_signature">
183
+
184
+ <a href="#find_timezone-instance_method" title="#find_timezone (instance method)">- (TimeZone) <strong>find_timezone</strong>(name = true, dst_label = nil) </a>
185
+
186
+
187
+
188
+ </span>
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+ <span class="summary_desc"><div class='inline'><p>Find a zone by its name.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#is_valid%3F-instance_method" title="#is_valid? (instance method)">- (Boolean) <strong>is_valid?</strong>(value, format = &quot;%F %T&quot;) </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'><p>Checks if the date is valid against to a specific format.</p>
222
+ </div></span>
223
+
224
+ </li>
225
+
226
+
227
+ <li class="public ">
228
+ <span class="summary_signature">
229
+
230
+ <a href="#list_timezones-instance_method" title="#list_timezones (instance method)">- (Array) <strong>list_timezones</strong>(with_dst = true, dst_label = nil) </a>
231
+
232
+
233
+
234
+ </span>
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+ <span class="summary_desc"><div class='inline'><p>Returns a list of names of all timezones.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ <li class="public ">
251
+ <span class="summary_signature">
252
+
253
+ <a href="#months-instance_method" title="#months (instance method)">- (Array) <strong>months</strong>(short = true) </a>
254
+
255
+
256
+
257
+ </span>
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+ <span class="summary_desc"><div class='inline'><p>Returns strings representations of months.</p>
268
+ </div></span>
269
+
270
+ </li>
271
+
272
+
273
+ <li class="public ">
274
+ <span class="summary_signature">
275
+
276
+ <a href="#parameterize_zone-instance_method" title="#parameterize_zone (instance method)">- (String) <strong>parameterize_zone</strong>(tz, with_offset = true) </a>
277
+
278
+
279
+
280
+ </span>
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+ <span class="summary_desc"><div class='inline'><p>Returns a string representation of a timezone.</p>
291
+ </div></span>
292
+
293
+ </li>
294
+
295
+
296
+ <li class="public ">
297
+ <span class="summary_signature">
298
+
299
+ <a href="#rationalize_offset-instance_method" title="#rationalize_offset (instance method)">- (Rational) <strong>rationalize_offset</strong>(offset) </a>
300
+
301
+
302
+
303
+ </span>
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+ <span class="summary_desc"><div class='inline'><p>Returns an offset in rational value.</p>
314
+ </div></span>
315
+
316
+ </li>
317
+
318
+
319
+ <li class="public ">
320
+ <span class="summary_signature">
321
+
322
+ <a href="#timezones-instance_method" title="#timezones (instance method)">- (Array) <strong>timezones</strong> </a>
323
+
324
+
325
+
326
+ </span>
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+ <span class="summary_desc"><div class='inline'><p>Returns all the availabe timezones.</p>
337
+ </div></span>
338
+
339
+ </li>
340
+
341
+
342
+ <li class="public ">
343
+ <span class="summary_signature">
344
+
345
+ <a href="#unparameterize_zone-instance_method" title="#unparameterize_zone (instance method)">- (String|TimeZone) <strong>unparameterize_zone</strong>(tz, as_string = false, dst_label = nil) </a>
346
+
347
+
348
+
349
+ </span>
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+ <span class="summary_desc"><div class='inline'><p>Finds a parameterized timezone.</p>
360
+ </div></span>
361
+
362
+ </li>
363
+
364
+
365
+ <li class="public ">
366
+ <span class="summary_signature">
367
+
368
+ <a href="#years-instance_method" title="#years (instance method)">- (Array) <strong>years</strong>(offset = 10, also_future = true, reference = nil, as_objects = false) </a>
369
+
370
+
371
+
372
+ </span>
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+ <span class="summary_desc"><div class='inline'><p>Returns a range of years.</p>
383
+ </div></span>
384
+
385
+ </li>
386
+
387
+
388
+ </ul>
389
+
390
+
391
+
392
+
393
+ <div id="instance_method_details" class="method_details_list">
394
+ <h2>Instance Method Details</h2>
395
+
396
+
397
+ <div class="method_details first">
398
+ <h3 class="signature first" id="custom_format-instance_method">
399
+
400
+ - (<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>custom_format</strong>(key)
401
+
402
+
403
+
404
+
405
+
406
+ </h3><div class="docstring">
407
+ <div class="discussion">
408
+ <p>Lookups a custom datetime format.</p>
409
+
410
+
411
+ </div>
412
+ </div>
413
+ <div class="tags">
414
+ <p class="tag_title">Parameters:</p>
415
+ <ul class="param">
416
+
417
+ <li>
418
+
419
+ <span class='name'>key</span>
420
+
421
+
422
+ <span class='type'>(<tt>Symbol</tt>)</span>
423
+
424
+
425
+
426
+ &mdash;
427
+ <div class='inline'><p>The name of the format to search.</p>
428
+ </div>
429
+
430
+ </li>
431
+
432
+ </ul>
433
+
434
+ <p class="tag_title">Returns:</p>
435
+ <ul class="return">
436
+
437
+ <li>
438
+
439
+
440
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
441
+
442
+
443
+
444
+ &mdash;
445
+ <div class='inline'><p>The format or the name itself (if the format has not been found).</p>
446
+ </div>
447
+
448
+ </li>
449
+
450
+ </ul>
451
+
452
+ <p class="tag_title">See Also:</p>
453
+ <ul class="see">
454
+
455
+ <li><span class='object_link'><a href="../Settings.html#setup_date_formats-instance_method" title="Lazier::Settings#setup_date_formats (method)">Settings#setup_date_formats</a></span></li>
456
+
457
+ </ul>
458
+
459
+ </div><table class="source_code">
460
+ <tr>
461
+ <td>
462
+ <pre class="lines">
463
+
464
+
465
+ 151
466
+ 152
467
+ 153</pre>
468
+ </td>
469
+ <td>
470
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 151</span>
471
+
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>
475
+ </td>
476
+ </tr>
477
+ </table>
478
+ </div>
479
+
480
+ <div class="method_details ">
481
+ <h3 class="signature " id="days-instance_method">
482
+
483
+ - (<tt>Array</tt>) <strong>days</strong>(short = true)
484
+
485
+
486
+
487
+
488
+
489
+ </h3><div class="docstring">
490
+ <div class="discussion">
491
+ <p>Returns strings representations of days.</p>
492
+
493
+
494
+ </div>
495
+ </div>
496
+ <div class="tags">
497
+ <p class="tag_title">Parameters:</p>
498
+ <ul class="param">
499
+
500
+ <li>
501
+
502
+ <span class='name'>short</span>
503
+
504
+
505
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
506
+
507
+
508
+ <em class="default">(defaults to: <tt>true</tt>)</em>
509
+
510
+
511
+ &mdash;
512
+ <div class='inline'><p>If return the abbreviated representations.</p>
513
+ </div>
514
+
515
+ </li>
516
+
517
+ </ul>
518
+
519
+ <p class="tag_title">Returns:</p>
520
+ <ul class="return">
521
+
522
+ <li>
523
+
524
+
525
+ <span class='type'>(<tt>Array</tt>)</span>
526
+
527
+
528
+
529
+ &mdash;
530
+ <div class='inline'><p>Return string representations of days.</p>
531
+ </div>
532
+
533
+ </li>
534
+
535
+ </ul>
536
+
537
+ <p class="tag_title">See Also:</p>
538
+ <ul class="see">
539
+
540
+ <li><span class='object_link'><a href="../Settings.html#setup_date_names-instance_method" title="Lazier::Settings#setup_date_names (method)">Settings#setup_date_names</a></span></li>
541
+
542
+ </ul>
543
+
544
+ </div><table class="source_code">
545
+ <tr>
546
+ <td>
547
+ <pre class="lines">
548
+
549
+
550
+ 19
551
+ 20
552
+ 21
553
+ 22
554
+ 23
555
+ 24
556
+ 25</pre>
557
+ </td>
558
+ <td>
559
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 19</span>
560
+
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='symbol'>:value</span> <span class='op'>=&gt;</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='symbol'>:label</span><span class='op'>=&gt;</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>
566
+
567
+ <span class='kw'>end</span></pre>
568
+ </td>
569
+ </tr>
570
+ </table>
571
+ </div>
572
+
573
+ <div class="method_details ">
574
+ <h3 class="signature " id="easter-instance_method">
575
+
576
+ - (<tt>Date</tt>) <strong>easter</strong>(year = nil)
577
+
578
+
579
+
580
+
581
+
582
+ </h3><div class="docstring">
583
+ <div class="discussion">
584
+ <p>Returns the Easter (according to Gregorian calendar) date for the year.</p>
585
+
586
+
587
+ </div>
588
+ </div>
589
+ <div class="tags">
590
+ <p class="tag_title">Parameters:</p>
591
+ <ul class="param">
592
+
593
+ <li>
594
+
595
+ <span class='name'>year</span>
596
+
597
+
598
+ <span class='type'>(<tt>Fixnum</tt>)</span>
599
+
600
+
601
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
602
+
603
+
604
+ &mdash;
605
+ <div class='inline'><p>The year to compute the date for. Defaults to the current year.</p>
606
+ </div>
607
+
608
+ </li>
609
+
610
+ </ul>
611
+
612
+ <p class="tag_title">Returns:</p>
613
+ <ul class="return">
614
+
615
+ <li>
616
+
617
+
618
+ <span class='type'>(<tt>Date</tt>)</span>
619
+
620
+
621
+
622
+ &mdash;
623
+ <div class='inline'><p>The Easter date for the year.</p>
624
+ </div>
625
+
626
+ </li>
627
+
628
+ </ul>
629
+
630
+ <p class="tag_title">See Also:</p>
631
+ <ul class="see">
632
+
633
+ <li><a href="http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm" target="_parent" title="http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm">http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm</a></li>
634
+
635
+ </ul>
636
+
637
+ </div><table class="source_code">
638
+ <tr>
639
+ <td>
640
+ <pre class="lines">
641
+
642
+
643
+ 124
644
+ 125
645
+ 126
646
+ 127
647
+ 128
648
+ 129
649
+ 130
650
+ 131
651
+ 132
652
+ 133
653
+ 134
654
+ 135
655
+ 136
656
+ 137
657
+ 138
658
+ 139
659
+ 140
660
+ 141
661
+ 142
662
+ 143
663
+ 144</pre>
664
+ </td>
665
+ <td>
666
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 124</span>
667
+
668
+ <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>
669
+ <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>
670
+
671
+ <span class='comment'># Compute using Anonymouse Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm
672
+ </span> <span class='id identifier rubyid_a'>a</span> <span class='op'>=</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>%</span> <span class='int'>19</span>
673
+ <span class='id identifier rubyid_b'>b</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span> <span class='op'>/</span> <span class='float'>100.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
674
+ <span class='id identifier rubyid_c'>c</span> <span class='op'>=</span> <span class='id identifier rubyid_year'>year</span> <span class='op'>%</span> <span class='int'>100</span>
675
+ <span class='id identifier rubyid_d'>d</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span> <span class='op'>/</span> <span class='float'>4.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
676
+ <span class='id identifier rubyid_e'>e</span> <span class='op'>=</span> <span class='id identifier rubyid_b'>b</span> <span class='op'>%</span> <span class='int'>4</span>
677
+ <span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span> <span class='op'>+</span> <span class='int'>8</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='float'>25.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
678
+ <span class='id identifier rubyid_g'>g</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span> <span class='op'>-</span> <span class='id identifier rubyid_f'>f</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='float'>3.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
679
+ <span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>19</span> <span class='op'>*</span> <span class='id identifier rubyid_a'>a</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_b'>b</span> <span class='op'>-</span> <span class='id identifier rubyid_d'>d</span> <span class='op'>-</span> <span class='id identifier rubyid_g'>g</span> <span class='op'>+</span> <span class='int'>15</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>30</span>
680
+ <span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span> <span class='op'>/</span> <span class='float'>4.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
681
+ <span class='id identifier rubyid_k'>k</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span> <span class='op'>%</span> <span class='int'>4</span>
682
+ <span class='id identifier rubyid_l'>l</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='int'>32</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>2</span> <span class='op'>*</span> <span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>2</span> <span class='op'>*</span> <span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='id identifier rubyid_h'>h</span> <span class='op'>-</span> <span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>7</span>
683
+ <span class='id identifier rubyid_m'>m</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>11</span> <span class='op'>*</span> <span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>22</span> <span class='op'>*</span> <span class='id identifier rubyid_l'>l</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='float'>451.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
684
+
685
+ <span class='id identifier rubyid_day'>day</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span> <span class='op'>+</span> <span class='id identifier rubyid_l'>l</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='int'>7</span> <span class='op'>*</span> <span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>114</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>31</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>1</span>
686
+ <span class='id identifier rubyid_month'>month</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span> <span class='op'>+</span> <span class='id identifier rubyid_l'>l</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='int'>7</span> <span class='op'>*</span> <span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>114</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='float'>31.0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span>
687
+ <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>
688
+ <span class='kw'>end</span></pre>
689
+ </td>
690
+ </tr>
691
+ </table>
692
+ </div>
693
+
694
+ <div class="method_details ">
695
+ <h3 class="signature " id="find_timezone-instance_method">
696
+
697
+ - (<tt><span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>) <strong>find_timezone</strong>(name = true, dst_label = nil)
698
+
699
+
700
+
701
+
702
+
703
+ </h3><div class="docstring">
704
+ <div class="discussion">
705
+ <p>Find a zone by its name.</p>
706
+
707
+
708
+ </div>
709
+ </div>
710
+ <div class="tags">
711
+ <p class="tag_title">Parameters:</p>
712
+ <ul class="param">
713
+
714
+ <li>
715
+
716
+ <span class='name'>name</span>
717
+
718
+
719
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
720
+
721
+
722
+ <em class="default">(defaults to: <tt>true</tt>)</em>
723
+
724
+
725
+ &mdash;
726
+ <div class='inline'><p>The zone name.</p>
727
+ </div>
728
+
729
+ </li>
730
+
731
+ <li>
732
+
733
+ <span class='name'>dst_label</span>
734
+
735
+
736
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
737
+
738
+
739
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
740
+
741
+
742
+ &mdash;
743
+ <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
744
+ </div>
745
+
746
+ </li>
747
+
748
+ </ul>
749
+
750
+ <p class="tag_title">Returns:</p>
751
+ <ul class="return">
752
+
753
+ <li>
754
+
755
+
756
+ <span class='type'>(<tt><span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>)</span>
757
+
758
+
759
+
760
+ &mdash;
761
+ <div class='inline'><p>A timezone or <code>nil</code> if no zone was found.</p>
762
+ </div>
763
+
764
+ </li>
765
+
766
+ </ul>
767
+
768
+ </div><table class="source_code">
769
+ <tr>
770
+ <td>
771
+ <pre class="lines">
772
+
773
+
774
+ 83
775
+ 84
776
+ 85</pre>
777
+ </td>
778
+ <td>
779
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 83</span>
780
+
781
+ <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>
782
+ <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>
783
+ <span class='kw'>end</span></pre>
784
+ </td>
785
+ </tr>
786
+ </table>
787
+ </div>
788
+
789
+ <div class="method_details ">
790
+ <h3 class="signature " id="is_valid?-instance_method">
791
+
792
+ - (<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>is_valid?</strong>(value, format = &quot;%F %T&quot;)
793
+
794
+
795
+
796
+
797
+
798
+ </h3><div class="docstring">
799
+ <div class="discussion">
800
+ <p>Checks if the date is valid against to a specific format.</p>
801
+
802
+
803
+ </div>
804
+ </div>
805
+ <div class="tags">
806
+ <p class="tag_title">Parameters:</p>
807
+ <ul class="param">
808
+
809
+ <li>
810
+
811
+ <span class='name'>value</span>
812
+
813
+
814
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
815
+
816
+
817
+
818
+ &mdash;
819
+ <div class='inline'><p>The value to check.</p>
820
+ </div>
821
+
822
+ </li>
823
+
824
+ <li>
825
+
826
+ <span class='name'>format</span>
827
+
828
+
829
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
830
+
831
+
832
+ <em class="default">(defaults to: <tt>&quot;%F %T&quot;</tt>)</em>
833
+
834
+
835
+ &mdash;
836
+ <div class='inline'><p>The format to check the value against.</p>
837
+ </div>
838
+
839
+ </li>
840
+
841
+ </ul>
842
+
843
+ <p class="tag_title">Returns:</p>
844
+ <ul class="return">
845
+
846
+ <li>
847
+
848
+
849
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
850
+
851
+
852
+
853
+ &mdash;
854
+ <div class='inline'><p><code>true</code> if the value is valid against the format, <code>false</code> otherwise.</p>
855
+ </div>
856
+
857
+ </li>
858
+
859
+ </ul>
860
+
861
+ <p class="tag_title">See Also:</p>
862
+ <ul class="see">
863
+
864
+ <li>DateTime#custom_format</li>
865
+
866
+ </ul>
867
+
868
+ </div><table class="source_code">
869
+ <tr>
870
+ <td>
871
+ <pre class="lines">
872
+
873
+
874
+ 161
875
+ 162
876
+ 163
877
+ 164
878
+ 165
879
+ 166
880
+ 167
881
+ 168
882
+ 169
883
+ 170
884
+ 171
885
+ 172
886
+ 173</pre>
887
+ </td>
888
+ <td>
889
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 161</span>
890
+
891
+ <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'>&quot;</span><span class='tstring_content'>%F %T</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
892
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>true</span>
893
+
894
+ <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>
895
+
896
+ <span class='kw'>begin</span>
897
+ <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>
898
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
899
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>false</span>
900
+ <span class='kw'>end</span>
901
+
902
+ <span class='id identifier rubyid_rv'>rv</span>
903
+ <span class='kw'>end</span></pre>
904
+ </td>
905
+ </tr>
906
+ </table>
907
+ </div>
908
+
909
+ <div class="method_details ">
910
+ <h3 class="signature " id="list_timezones-instance_method">
911
+
912
+ - (<tt>Array</tt>) <strong>list_timezones</strong>(with_dst = true, dst_label = nil)
913
+
914
+
915
+
916
+
917
+
918
+ </h3><div class="docstring">
919
+ <div class="discussion">
920
+ <p>Returns a list of names of all timezones.</p>
921
+
922
+
923
+ </div>
924
+ </div>
925
+ <div class="tags">
926
+ <p class="tag_title">Parameters:</p>
927
+ <ul class="param">
928
+
929
+ <li>
930
+
931
+ <span class='name'>with_dst</span>
932
+
933
+
934
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
935
+
936
+
937
+ <em class="default">(defaults to: <tt>true</tt>)</em>
938
+
939
+
940
+ &mdash;
941
+ <div class='inline'><p>If include DST version of the zones.</p>
942
+ </div>
943
+
944
+ </li>
945
+
946
+ <li>
947
+
948
+ <span class='name'>dst_label</span>
949
+
950
+
951
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
952
+
953
+
954
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
955
+
956
+
957
+ &mdash;
958
+ <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
959
+ </div>
960
+
961
+ </li>
962
+
963
+ </ul>
964
+
965
+ <p class="tag_title">Returns:</p>
966
+ <ul class="return">
967
+
968
+ <li>
969
+
970
+
971
+ <span class='type'>(<tt>Array</tt>)</span>
972
+
973
+
974
+
975
+ &mdash;
976
+ <div class='inline'><p>A list of names of timezones.</p>
977
+ </div>
978
+
979
+ </li>
980
+
981
+ </ul>
982
+
983
+ </div><table class="source_code">
984
+ <tr>
985
+ <td>
986
+ <pre class="lines">
987
+
988
+
989
+ 74
990
+ 75
991
+ 76</pre>
992
+ </td>
993
+ <td>
994
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 74</span>
995
+
996
+ <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>
997
+ <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>
998
+ <span class='kw'>end</span></pre>
999
+ </td>
1000
+ </tr>
1001
+ </table>
1002
+ </div>
1003
+
1004
+ <div class="method_details ">
1005
+ <h3 class="signature " id="months-instance_method">
1006
+
1007
+ - (<tt>Array</tt>) <strong>months</strong>(short = true)
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+ </h3><div class="docstring">
1014
+ <div class="discussion">
1015
+ <p>Returns strings representations of months.</p>
1016
+
1017
+
1018
+ </div>
1019
+ </div>
1020
+ <div class="tags">
1021
+ <p class="tag_title">Parameters:</p>
1022
+ <ul class="param">
1023
+
1024
+ <li>
1025
+
1026
+ <span class='name'>short</span>
1027
+
1028
+
1029
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1030
+
1031
+
1032
+ <em class="default">(defaults to: <tt>true</tt>)</em>
1033
+
1034
+
1035
+ &mdash;
1036
+ <div class='inline'><p>If return the abbreviated representations.</p>
1037
+ </div>
1038
+
1039
+ </li>
1040
+
1041
+ </ul>
1042
+
1043
+ <p class="tag_title">Returns:</p>
1044
+ <ul class="return">
1045
+
1046
+ <li>
1047
+
1048
+
1049
+ <span class='type'>(<tt>Array</tt>)</span>
1050
+
1051
+
1052
+
1053
+ &mdash;
1054
+ <div class='inline'><p>Return string representations of months.</p>
1055
+ </div>
1056
+
1057
+ </li>
1058
+
1059
+ </ul>
1060
+
1061
+ <p class="tag_title">See Also:</p>
1062
+ <ul class="see">
1063
+
1064
+ <li><span class='object_link'><a href="../Settings.html#setup_date_names-instance_method" title="Lazier::Settings#setup_date_names (method)">Settings#setup_date_names</a></span></li>
1065
+
1066
+ </ul>
1067
+
1068
+ </div><table class="source_code">
1069
+ <tr>
1070
+ <td>
1071
+ <pre class="lines">
1072
+
1073
+
1074
+ 32
1075
+ 33
1076
+ 34
1077
+ 35
1078
+ 36
1079
+ 37</pre>
1080
+ </td>
1081
+ <td>
1082
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 32</span>
1083
+
1084
+ <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>
1085
+ <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>
1086
+ <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>
1087
+ <span class='lbrace'>{</span><span class='symbol'>:value</span> <span class='op'>=&gt;</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'>&quot;</span><span class='tstring_content'>0</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:label</span><span class='op'>=&gt;</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>
1088
+ <span class='rbrace'>}</span>
1089
+ <span class='kw'>end</span></pre>
1090
+ </td>
1091
+ </tr>
1092
+ </table>
1093
+ </div>
1094
+
1095
+ <div class="method_details ">
1096
+ <h3 class="signature " id="parameterize_zone-instance_method">
1097
+
1098
+ - (<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>parameterize_zone</strong>(tz, with_offset = true)
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+ </h3><div class="docstring">
1105
+ <div class="discussion">
1106
+ <p>Returns a string representation of a timezone.</p>
1107
+
1108
+ <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'>&quot;</span><span class='tstring_content'>Pacific Time (US &amp; Canada)</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1109
+ <span class='comment'># =&gt; &quot;-0800@pacific-time-us-canada&quot;
1110
+ </span></code></pre>
1111
+
1112
+
1113
+ </div>
1114
+ </div>
1115
+ <div class="tags">
1116
+ <p class="tag_title">Parameters:</p>
1117
+ <ul class="param">
1118
+
1119
+ <li>
1120
+
1121
+ <span class='name'>tz</span>
1122
+
1123
+
1124
+ <span class='type'>(<tt><span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>)</span>
1125
+
1126
+
1127
+
1128
+ &mdash;
1129
+ <div class='inline'><p>The zone to represent.</p>
1130
+ </div>
1131
+
1132
+ </li>
1133
+
1134
+ <li>
1135
+
1136
+ <span class='name'>with_offset</span>
1137
+
1138
+
1139
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1140
+
1141
+
1142
+ <em class="default">(defaults to: <tt>true</tt>)</em>
1143
+
1144
+
1145
+ &mdash;
1146
+ <div class='inline'><p>If to include offset into the representation.</p>
1147
+ </div>
1148
+
1149
+ </li>
1150
+
1151
+ </ul>
1152
+
1153
+ <p class="tag_title">Returns:</p>
1154
+ <ul class="return">
1155
+
1156
+ <li>
1157
+
1158
+
1159
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
1160
+
1161
+
1162
+
1163
+ &mdash;
1164
+ <div class='inline'><p>A string representation which can be used for searches.</p>
1165
+ </div>
1166
+
1167
+ </li>
1168
+
1169
+ </ul>
1170
+
1171
+ </div><table class="source_code">
1172
+ <tr>
1173
+ <td>
1174
+ <pre class="lines">
1175
+
1176
+
1177
+ 96
1178
+ 97
1179
+ 98</pre>
1180
+ </td>
1181
+ <td>
1182
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 96</span>
1183
+
1184
+ <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>
1185
+ <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>
1186
+ <span class='kw'>end</span></pre>
1187
+ </td>
1188
+ </tr>
1189
+ </table>
1190
+ </div>
1191
+
1192
+ <div class="method_details ">
1193
+ <h3 class="signature " id="rationalize_offset-instance_method">
1194
+
1195
+ - (<tt>Rational</tt>) <strong>rationalize_offset</strong>(offset)
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+ </h3><div class="docstring">
1202
+ <div class="discussion">
1203
+ <p>Returns an offset in rational value.</p>
1204
+
1205
+
1206
+ </div>
1207
+ </div>
1208
+ <div class="tags">
1209
+ <p class="tag_title">Parameters:</p>
1210
+ <ul class="param">
1211
+
1212
+ <li>
1213
+
1214
+ <span class='name'>offset</span>
1215
+
1216
+
1217
+ <span class='type'>(<tt>Fixnum</tt>)</span>
1218
+
1219
+
1220
+
1221
+ &mdash;
1222
+ <div class='inline'><p>The offset to convert.</p>
1223
+ </div>
1224
+
1225
+ </li>
1226
+
1227
+ </ul>
1228
+
1229
+ <p class="tag_title">Returns:</p>
1230
+ <ul class="return">
1231
+
1232
+ <li>
1233
+
1234
+
1235
+ <span class='type'>(<tt>Rational</tt>)</span>
1236
+
1237
+
1238
+
1239
+ &mdash;
1240
+ <div class='inline'><p>The converted offset.</p>
1241
+ </div>
1242
+
1243
+ </li>
1244
+
1245
+ </ul>
1246
+
1247
+ </div><table class="source_code">
1248
+ <tr>
1249
+ <td>
1250
+ <pre class="lines">
1251
+
1252
+
1253
+ 115
1254
+ 116
1255
+ 117</pre>
1256
+ </td>
1257
+ <td>
1258
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 115</span>
1259
+
1260
+ <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>
1261
+ <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>
1262
+ <span class='kw'>end</span></pre>
1263
+ </td>
1264
+ </tr>
1265
+ </table>
1266
+ </div>
1267
+
1268
+ <div class="method_details ">
1269
+ <h3 class="signature " id="timezones-instance_method">
1270
+
1271
+ - (<tt>Array</tt>) <strong>timezones</strong>
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+ </h3><div class="docstring">
1278
+ <div class="discussion">
1279
+ <p>Returns all the availabe timezones.</p>
1280
+
1281
+
1282
+ </div>
1283
+ </div>
1284
+ <div class="tags">
1285
+
1286
+ <p class="tag_title">Returns:</p>
1287
+ <ul class="return">
1288
+
1289
+ <li>
1290
+
1291
+
1292
+ <span class='type'>(<tt>Array</tt>)</span>
1293
+
1294
+
1295
+
1296
+ &mdash;
1297
+ <div class='inline'><p>All the zone available.</p>
1298
+ </div>
1299
+
1300
+ </li>
1301
+
1302
+ </ul>
1303
+
1304
+ </div><table class="source_code">
1305
+ <tr>
1306
+ <td>
1307
+ <pre class="lines">
1308
+
1309
+
1310
+ 65
1311
+ 66
1312
+ 67</pre>
1313
+ </td>
1314
+ <td>
1315
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 65</span>
1316
+
1317
+ <span class='kw'>def</span> <span class='id identifier rubyid_timezones'>timezones</span>
1318
+ <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>
1319
+ <span class='kw'>end</span></pre>
1320
+ </td>
1321
+ </tr>
1322
+ </table>
1323
+ </div>
1324
+
1325
+ <div class="method_details ">
1326
+ <h3 class="signature " id="unparameterize_zone-instance_method">
1327
+
1328
+ - (<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span>|<span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>) <strong>unparameterize_zone</strong>(tz, as_string = false, dst_label = nil)
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+ </h3><div class="docstring">
1335
+ <div class="discussion">
1336
+ <p>Finds a parameterized timezone.</p>
1337
+
1338
+
1339
+ </div>
1340
+ </div>
1341
+ <div class="tags">
1342
+ <p class="tag_title">Parameters:</p>
1343
+ <ul class="param">
1344
+
1345
+ <li>
1346
+
1347
+ <span class='name'>tz</span>
1348
+
1349
+
1350
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
1351
+
1352
+
1353
+
1354
+ &mdash;
1355
+ <div class='inline'><p>The zone to unparameterize.</p>
1356
+ </div>
1357
+
1358
+ </li>
1359
+
1360
+ <li>
1361
+
1362
+ <span class='name'>as_string</span>
1363
+
1364
+
1365
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1366
+
1367
+
1368
+ <em class="default">(defaults to: <tt>false</tt>)</em>
1369
+
1370
+
1371
+ &mdash;
1372
+ <div class='inline'><p>If return just the zone name.</p>
1373
+ </div>
1374
+
1375
+ </li>
1376
+
1377
+ <li>
1378
+
1379
+ <span class='name'>dst_label</span>
1380
+
1381
+
1382
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
1383
+
1384
+
1385
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1386
+
1387
+
1388
+ &mdash;
1389
+ <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
1390
+ </div>
1391
+
1392
+ </li>
1393
+
1394
+ </ul>
1395
+
1396
+ <p class="tag_title">Returns:</p>
1397
+ <ul class="return">
1398
+
1399
+ <li>
1400
+
1401
+
1402
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span>|<span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>)</span>
1403
+
1404
+
1405
+
1406
+ &mdash;
1407
+ <div class='inline'><p>The found timezone or <code>nil</code> if the zone is not valid.</p>
1408
+ </div>
1409
+
1410
+ </li>
1411
+
1412
+ </ul>
1413
+
1414
+ <p class="tag_title">See Also:</p>
1415
+ <ul class="see">
1416
+
1417
+ <li>DateTime#parameterize_zone</li>
1418
+
1419
+ </ul>
1420
+
1421
+ </div><table class="source_code">
1422
+ <tr>
1423
+ <td>
1424
+ <pre class="lines">
1425
+
1426
+
1427
+ 107
1428
+ 108
1429
+ 109</pre>
1430
+ </td>
1431
+ <td>
1432
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 107</span>
1433
+
1434
+ <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>
1435
+ <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>
1436
+ <span class='kw'>end</span></pre>
1437
+ </td>
1438
+ </tr>
1439
+ </table>
1440
+ </div>
1441
+
1442
+ <div class="method_details ">
1443
+ <h3 class="signature " id="years-instance_method">
1444
+
1445
+ - (<tt>Array</tt>) <strong>years</strong>(offset = 10, also_future = true, reference = nil, as_objects = false)
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+ </h3><div class="docstring">
1452
+ <div class="discussion">
1453
+ <p>Returns a range of years.</p>
1454
+
1455
+ <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>
1456
+ <span class='comment'># =&gt; [2007, 2008, 2009, 2010]
1457
+ </span></code></pre>
1458
+
1459
+ <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>
1460
+ <span class='comment'># =&gt; [{:value=&gt;2009, :label=&gt;2009}, {:value=&gt;2010, :label=&gt;2010}, {:value=&gt;2011, :label=&gt;2011}]
1461
+ </span></code></pre>
1462
+
1463
+
1464
+ </div>
1465
+ </div>
1466
+ <div class="tags">
1467
+ <p class="tag_title">Parameters:</p>
1468
+ <ul class="param">
1469
+
1470
+ <li>
1471
+
1472
+ <span class='name'>offset</span>
1473
+
1474
+
1475
+ <span class='type'>(<tt>Fixnum</tt>)</span>
1476
+
1477
+
1478
+ <em class="default">(defaults to: <tt>10</tt>)</em>
1479
+
1480
+
1481
+ &mdash;
1482
+ <div class='inline'><p>The width of the range.</p>
1483
+ </div>
1484
+
1485
+ </li>
1486
+
1487
+ <li>
1488
+
1489
+ <span class='name'>also_future</span>
1490
+
1491
+
1492
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1493
+
1494
+
1495
+ <em class="default">(defaults to: <tt>true</tt>)</em>
1496
+
1497
+
1498
+ &mdash;
1499
+ <div class='inline'><p>If return also future years.</p>
1500
+ </div>
1501
+
1502
+ </li>
1503
+
1504
+ <li>
1505
+
1506
+ <span class='name'>reference</span>
1507
+
1508
+
1509
+ <span class='type'>(<tt>Fixnum</tt>)</span>
1510
+
1511
+
1512
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1513
+
1514
+
1515
+ &mdash;
1516
+ <div class='inline'><p>The ending (or middle, if <code>also_future</code> is <code>true</code>) value of the range. Defaults to the current year.</p>
1517
+ </div>
1518
+
1519
+ </li>
1520
+
1521
+ <li>
1522
+
1523
+ <span class='name'>as_objects</span>
1524
+
1525
+
1526
+ <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
1527
+
1528
+
1529
+ <em class="default">(defaults to: <tt>false</tt>)</em>
1530
+
1531
+
1532
+ &mdash;
1533
+ <div class='inline'><p>If to return years in hashes with <code>:value</code> and <code>label</code> keys.</p>
1534
+ </div>
1535
+
1536
+ </li>
1537
+
1538
+ </ul>
1539
+
1540
+ <p class="tag_title">Returns:</p>
1541
+ <ul class="return">
1542
+
1543
+ <li>
1544
+
1545
+
1546
+ <span class='type'>(<tt>Array</tt>)</span>
1547
+
1548
+
1549
+
1550
+ &mdash;
1551
+ <div class='inline'><p>A range of years. Every entry is</p>
1552
+ </div>
1553
+
1554
+ </li>
1555
+
1556
+ </ul>
1557
+
1558
+ </div><table class="source_code">
1559
+ <tr>
1560
+ <td>
1561
+ <pre class="lines">
1562
+
1563
+
1564
+ 57
1565
+ 58
1566
+ 59
1567
+ 60</pre>
1568
+ </td>
1569
+ <td>
1570
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 57</span>
1571
+
1572
+ <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>
1573
+ <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>
1574
+ <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='symbol'>:value</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='symbol'>:label</span> <span class='op'>=&gt;</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>
1575
+ <span class='kw'>end</span></pre>
1576
+ </td>
1577
+ </tr>
1578
+ </table>
1579
+ </div>
1580
+
1581
+ </div>
1582
+
1583
+ </div>
1584
+
1585
+ <div id="footer">
1586
+ Generated on Wed Aug 1 08:57:56 2012 by
1587
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1588
+ 0.8.2.1 (ruby-1.9.2).
1589
+ </div>
1590
+
1591
+ </body>
1592
+ </html>