lazier 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.rubocop.yml +29 -0
- data/.travis-gemfile +1 -1
- data/.travis.yml +2 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -3
- data/README.md +1 -1
- data/doc/Lazier.html +56 -68
- data/doc/Lazier/Boolean.html +4 -4
- data/doc/Lazier/Configuration.html +5 -5
- data/doc/Lazier/DateTime.html +29 -29
- data/doc/Lazier/DateTime/ClassMethods.html +136 -124
- data/doc/Lazier/Exceptions.html +4 -4
- data/doc/Lazier/Exceptions/Debug.html +4 -4
- data/doc/Lazier/Exceptions/MissingTranslation.html +4 -4
- data/doc/Lazier/Hash.html +144 -32
- data/doc/Lazier/I18n.html +109 -103
- data/doc/Lazier/Localizer.html +4 -4
- data/doc/Lazier/Math.html +4 -4
- data/doc/Lazier/Math/ClassMethods.html +4 -4
- data/doc/Lazier/Object.html +357 -243
- data/doc/Lazier/Pathname.html +4 -4
- data/doc/Lazier/Settings.html +58 -34
- data/doc/Lazier/String.html +6 -6
- data/doc/Lazier/TimeZone.html +86 -86
- data/doc/Lazier/TimeZone/ClassMethods.html +66 -68
- data/doc/Lazier/Version.html +5 -5
- data/doc/_index.html +5 -5
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +4 -4
- data/doc/frames.html +1 -1
- data/doc/index.html +4 -4
- data/doc/method_list.html +103 -91
- data/doc/top-level-namespace.html +4 -4
- data/lazier.gemspec +2 -2
- data/lib/lazier.rb +59 -22
- data/lib/lazier/boolean.rb +1 -1
- data/lib/lazier/configuration.rb +21 -20
- data/lib/lazier/datetime.rb +127 -101
- data/lib/lazier/hash.rb +20 -12
- data/lib/lazier/i18n.rb +33 -32
- data/lib/lazier/math.rb +1 -1
- data/lib/lazier/object.rb +102 -56
- data/lib/lazier/pathname.rb +1 -1
- data/lib/lazier/settings.rb +4 -2
- data/lib/lazier/string.rb +3 -3
- data/lib/lazier/version.rb +1 -1
- data/spec/lazier/datetime_spec.rb +1 -1
- data/spec/lazier/hash_spec.rb +2 -2
- data/spec/lazier/object_spec.rb +16 -0
- data/spec/lazier/string_spec.rb +4 -10
- data/spec/lazier_spec.rb +9 -9
- data/spec/spec_helper.rb +1 -1
- metadata +7 -6
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.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../';
|
20
|
-
framesUrl = "../frames.html#!"
|
20
|
+
framesUrl = "../frames.html#!Lazier/DateTime.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -339,12 +339,12 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
339
339
|
<pre class="lines">
|
340
340
|
|
341
341
|
|
342
|
-
|
343
|
-
|
344
|
-
|
342
|
+
227
|
343
|
+
228
|
344
|
+
229</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 227</span>
|
348
348
|
|
349
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
350
|
<span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span> <span class='op'>-</span> <span class='lparen'>(</span><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><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='int'>12</span> <span class='op'>+</span> <span class='id identifier rubyid_month'>month</span>
|
@@ -424,12 +424,12 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
424
424
|
<pre class="lines">
|
425
425
|
|
426
426
|
|
427
|
-
|
428
|
-
|
429
|
-
|
427
|
+
260
|
428
|
+
261
|
429
|
+
262</pre>
|
430
430
|
</td>
|
431
431
|
<td>
|
432
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
432
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 260</span>
|
433
433
|
|
434
434
|
<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>
|
435
435
|
<span class='lparen'>(</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='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>
|
@@ -502,12 +502,12 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
502
502
|
<pre class="lines">
|
503
503
|
|
504
504
|
|
505
|
-
|
506
|
-
|
507
|
-
|
505
|
+
251
|
506
|
+
252
|
507
|
+
253</pre>
|
508
508
|
</td>
|
509
509
|
<td>
|
510
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
510
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 251</span>
|
511
511
|
|
512
512
|
<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>
|
513
513
|
<span class='lparen'>(</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='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>
|
@@ -587,15 +587,15 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
587
587
|
<pre class="lines">
|
588
588
|
|
589
589
|
|
590
|
-
|
591
|
-
|
592
|
-
|
590
|
+
243
|
591
|
+
244
|
592
|
+
245</pre>
|
593
593
|
</td>
|
594
594
|
<td>
|
595
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
595
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 243</span>
|
596
596
|
|
597
597
|
<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>
|
598
|
-
<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='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?<!%)(%[ab])</span><span class='regexp_end'>/i</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span
|
598
|
+
<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='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?<!%)(%[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_localize_time_component'>localize_time_component</span><span class='lparen'>(</span><span class='id identifier rubyid_mo'>mo</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
599
599
|
<span class='kw'>end</span></pre>
|
600
600
|
</td>
|
601
601
|
</tr>
|
@@ -644,12 +644,12 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
644
644
|
<pre class="lines">
|
645
645
|
|
646
646
|
|
647
|
-
|
648
|
-
|
649
|
-
|
647
|
+
234
|
648
|
+
235
|
649
|
+
236</pre>
|
650
650
|
</td>
|
651
651
|
<td>
|
652
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
652
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 234</span>
|
653
653
|
|
654
654
|
<span class='kw'>def</span> <span class='id identifier rubyid_padded_month'>padded_month</span>
|
655
655
|
<span class='id identifier rubyid_month'>month</span><span class='period'>.</span><span class='id identifier rubyid_indexize'>indexize</span>
|
@@ -701,12 +701,12 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
701
701
|
<pre class="lines">
|
702
702
|
|
703
703
|
|
704
|
-
|
705
|
-
|
706
|
-
|
704
|
+
214
|
705
|
+
215
|
706
|
+
216</pre>
|
707
707
|
</td>
|
708
708
|
<td>
|
709
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line
|
709
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 214</span>
|
710
710
|
|
711
711
|
<span class='kw'>def</span> <span class='id identifier rubyid_utc_time'>utc_time</span>
|
712
712
|
<span class='id identifier rubyid_utc'>utc</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span>
|
@@ -721,9 +721,9 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
721
721
|
</div>
|
722
722
|
|
723
723
|
<div id="footer">
|
724
|
-
Generated on Sun
|
724
|
+
Generated on Sun Apr 27 17:16:42 2014 by
|
725
725
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
726
|
-
0.8.7.
|
726
|
+
0.8.7.4 (ruby-2.1.0).
|
727
727
|
</div>
|
728
728
|
|
729
729
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Lazier::DateTime::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!"
|
20
|
+
framesUrl = "../../frames.html#!Lazier/DateTime/ClassMethods.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -204,7 +204,7 @@
|
|
204
204
|
<li class="public ">
|
205
205
|
<span class="summary_signature">
|
206
206
|
|
207
|
-
<a href="#
|
207
|
+
<a href="#list_timezones-instance_method" title="#list_timezones (instance method)">- (Array) <strong>list_timezones</strong>(with_dst = true, dst_label = nil) </a>
|
208
208
|
|
209
209
|
|
210
210
|
|
@@ -218,7 +218,7 @@
|
|
218
218
|
|
219
219
|
|
220
220
|
|
221
|
-
<span class="summary_desc"><div class='inline'><p>
|
221
|
+
<span class="summary_desc"><div class='inline'><p>Returns a list of names of all timezones.</p>
|
222
222
|
</div></span>
|
223
223
|
|
224
224
|
</li>
|
@@ -227,7 +227,7 @@
|
|
227
227
|
<li class="public ">
|
228
228
|
<span class="summary_signature">
|
229
229
|
|
230
|
-
<a href="#
|
230
|
+
<a href="#months-instance_method" title="#months (instance method)">- (Array) <strong>months</strong>(short = true) </a>
|
231
231
|
|
232
232
|
|
233
233
|
|
@@ -241,7 +241,7 @@
|
|
241
241
|
|
242
242
|
|
243
243
|
|
244
|
-
<span class="summary_desc"><div class='inline'><p>Returns
|
244
|
+
<span class="summary_desc"><div class='inline'><p>Returns strings representations of months.</p>
|
245
245
|
</div></span>
|
246
246
|
|
247
247
|
</li>
|
@@ -250,7 +250,7 @@
|
|
250
250
|
<li class="public ">
|
251
251
|
<span class="summary_signature">
|
252
252
|
|
253
|
-
<a href="#
|
253
|
+
<a href="#parameterize_zone-instance_method" title="#parameterize_zone (instance method)">- (String) <strong>parameterize_zone</strong>(tz, with_offset = true) </a>
|
254
254
|
|
255
255
|
|
256
256
|
|
@@ -264,7 +264,7 @@
|
|
264
264
|
|
265
265
|
|
266
266
|
|
267
|
-
<span class="summary_desc"><div class='inline'><p>Returns
|
267
|
+
<span class="summary_desc"><div class='inline'><p>Returns a string representation of a timezone.</p>
|
268
268
|
</div></span>
|
269
269
|
|
270
270
|
</li>
|
@@ -273,7 +273,7 @@
|
|
273
273
|
<li class="public ">
|
274
274
|
<span class="summary_signature">
|
275
275
|
|
276
|
-
<a href="#
|
276
|
+
<a href="#rationalize_offset-instance_method" title="#rationalize_offset (instance method)">- (Rational) <strong>rationalize_offset</strong>(offset) </a>
|
277
277
|
|
278
278
|
|
279
279
|
|
@@ -287,7 +287,7 @@
|
|
287
287
|
|
288
288
|
|
289
289
|
|
290
|
-
<span class="summary_desc"><div class='inline'><p>Returns
|
290
|
+
<span class="summary_desc"><div class='inline'><p>Returns an offset in rational value.</p>
|
291
291
|
</div></span>
|
292
292
|
|
293
293
|
</li>
|
@@ -296,7 +296,7 @@
|
|
296
296
|
<li class="public ">
|
297
297
|
<span class="summary_signature">
|
298
298
|
|
299
|
-
<a href="#
|
299
|
+
<a href="#timezones-instance_method" title="#timezones (instance method)">- (Array) <strong>timezones</strong> </a>
|
300
300
|
|
301
301
|
|
302
302
|
|
@@ -310,7 +310,7 @@
|
|
310
310
|
|
311
311
|
|
312
312
|
|
313
|
-
<span class="summary_desc"><div class='inline'><p>Returns
|
313
|
+
<span class="summary_desc"><div class='inline'><p>Returns all the availabe timezones.</p>
|
314
314
|
</div></span>
|
315
315
|
|
316
316
|
</li>
|
@@ -319,7 +319,7 @@
|
|
319
319
|
<li class="public ">
|
320
320
|
<span class="summary_signature">
|
321
321
|
|
322
|
-
<a href="#
|
322
|
+
<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>
|
323
323
|
|
324
324
|
|
325
325
|
|
@@ -333,7 +333,7 @@
|
|
333
333
|
|
334
334
|
|
335
335
|
|
336
|
-
<span class="summary_desc"><div class='inline'><p>
|
336
|
+
<span class="summary_desc"><div class='inline'><p>Finds a parameterized timezone.</p>
|
337
337
|
</div></span>
|
338
338
|
|
339
339
|
</li>
|
@@ -342,10 +342,12 @@
|
|
342
342
|
<li class="public ">
|
343
343
|
<span class="summary_signature">
|
344
344
|
|
345
|
-
<a href="#
|
345
|
+
<a href="#valid%3F-instance_method" title="#valid? (instance method)">- (Boolean) <strong>valid?</strong>(value, format = "%F %T") </a>
|
346
346
|
|
347
347
|
|
348
348
|
|
349
|
+
(also: #is_valid?)
|
350
|
+
|
349
351
|
</span>
|
350
352
|
|
351
353
|
|
@@ -356,7 +358,7 @@
|
|
356
358
|
|
357
359
|
|
358
360
|
|
359
|
-
<span class="summary_desc"><div class='inline'><p>
|
361
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the date is valid against to a specific format.</p>
|
360
362
|
</div></span>
|
361
363
|
|
362
364
|
</li>
|
@@ -653,13 +655,13 @@
|
|
653
655
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 121</span>
|
654
656
|
|
655
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>
|
656
|
-
<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'>
|
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'>unless</span> <span class='id identifier rubyid_year'>year</span><span class='period'>.</span><span class='id identifier rubyid_is_integer?'>is_integer?</span>
|
657
659
|
|
658
660
|
<span class='comment'># Compute using Anonymous Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm
|
659
661
|
</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_start'>easter_start</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span>
|
660
|
-
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier
|
661
|
-
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier
|
662
|
-
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier
|
662
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_divide'>easter_divide</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
663
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_aggregate'>easter_aggregate</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
664
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_easter_prepare'>easter_prepare</span><span class='lparen'>(</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
663
665
|
<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_end'>easter_end</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
664
666
|
|
665
667
|
<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>
|
@@ -762,106 +764,6 @@
|
|
762
764
|
</td>
|
763
765
|
</tr>
|
764
766
|
</table>
|
765
|
-
</div>
|
766
|
-
|
767
|
-
<div class="method_details ">
|
768
|
-
<h3 class="signature " id="is_valid?-instance_method">
|
769
|
-
|
770
|
-
- (<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>is_valid?</strong>(value, format = "%F %T")
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
</h3><div class="docstring">
|
777
|
-
<div class="discussion">
|
778
|
-
<p>Checks if the date is valid against to a specific format.</p>
|
779
|
-
|
780
|
-
|
781
|
-
</div>
|
782
|
-
</div>
|
783
|
-
<div class="tags">
|
784
|
-
<p class="tag_title">Parameters:</p>
|
785
|
-
<ul class="param">
|
786
|
-
|
787
|
-
<li>
|
788
|
-
|
789
|
-
<span class='name'>value</span>
|
790
|
-
|
791
|
-
|
792
|
-
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
—
|
797
|
-
<div class='inline'><p>The value to check.</p>
|
798
|
-
</div>
|
799
|
-
|
800
|
-
</li>
|
801
|
-
|
802
|
-
<li>
|
803
|
-
|
804
|
-
<span class='name'>format</span>
|
805
|
-
|
806
|
-
|
807
|
-
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
808
|
-
|
809
|
-
|
810
|
-
<em class="default">(defaults to: <tt>"%F %T"</tt>)</em>
|
811
|
-
|
812
|
-
|
813
|
-
—
|
814
|
-
<div class='inline'><p>The format to check the value against.</p>
|
815
|
-
</div>
|
816
|
-
|
817
|
-
</li>
|
818
|
-
|
819
|
-
</ul>
|
820
|
-
|
821
|
-
<p class="tag_title">Returns:</p>
|
822
|
-
<ul class="return">
|
823
|
-
|
824
|
-
<li>
|
825
|
-
|
826
|
-
|
827
|
-
<span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
—
|
832
|
-
<div class='inline'><p><code>true</code> if the value is valid against the format, <code>false</code> otherwise.</p>
|
833
|
-
</div>
|
834
|
-
|
835
|
-
</li>
|
836
|
-
|
837
|
-
</ul>
|
838
|
-
|
839
|
-
<p class="tag_title">See Also:</p>
|
840
|
-
<ul class="see">
|
841
|
-
|
842
|
-
<li>DateTime#custom_format</li>
|
843
|
-
|
844
|
-
</ul>
|
845
|
-
|
846
|
-
</div><table class="source_code">
|
847
|
-
<tr>
|
848
|
-
<td>
|
849
|
-
<pre class="lines">
|
850
|
-
|
851
|
-
|
852
|
-
149
|
853
|
-
150
|
854
|
-
151</pre>
|
855
|
-
</td>
|
856
|
-
<td>
|
857
|
-
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 149</span>
|
858
|
-
|
859
|
-
<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>
|
860
|
-
<span class='op'>!</span><span class='lparen'>(</span><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='comma'>,</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><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
861
|
-
<span class='kw'>end</span></pre>
|
862
|
-
</td>
|
863
|
-
</tr>
|
864
|
-
</table>
|
865
767
|
</div>
|
866
768
|
|
867
769
|
<div class="method_details ">
|
@@ -1139,7 +1041,7 @@ DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US & Canad
|
|
1139
1041
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 93</span>
|
1140
1042
|
|
1141
1043
|
<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>
|
1142
|
-
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='
|
1044
|
+
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_parameterize_zone'>parameterize_zone</span><span class='lparen'>(</span><span class='id identifier rubyid_tz'>tz</span><span class='comma'>,</span> <span class='id identifier rubyid_with_offset'>with_offset</span><span class='rparen'>)</span>
|
1143
1045
|
<span class='kw'>end</span></pre>
|
1144
1046
|
</td>
|
1145
1047
|
</tr>
|
@@ -1389,7 +1291,117 @@ DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US & Canad
|
|
1389
1291
|
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 104</span>
|
1390
1292
|
|
1391
1293
|
<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>
|
1392
|
-
<span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='
|
1294
|
+
<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_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>
|
1295
|
+
<span class='kw'>end</span></pre>
|
1296
|
+
</td>
|
1297
|
+
</tr>
|
1298
|
+
</table>
|
1299
|
+
</div>
|
1300
|
+
|
1301
|
+
<div class="method_details ">
|
1302
|
+
<h3 class="signature " id="valid?-instance_method">
|
1303
|
+
|
1304
|
+
- (<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>valid?</strong>(value, format = "%F %T")
|
1305
|
+
|
1306
|
+
|
1307
|
+
|
1308
|
+
<span class="aliases">Also known as:
|
1309
|
+
<span class="names"><span id='is_valid?-instance_method'>is_valid?</span></span>
|
1310
|
+
</span>
|
1311
|
+
|
1312
|
+
|
1313
|
+
|
1314
|
+
</h3><div class="docstring">
|
1315
|
+
<div class="discussion">
|
1316
|
+
<p>Checks if the date is valid against to a specific format.</p>
|
1317
|
+
|
1318
|
+
|
1319
|
+
</div>
|
1320
|
+
</div>
|
1321
|
+
<div class="tags">
|
1322
|
+
<p class="tag_title">Parameters:</p>
|
1323
|
+
<ul class="param">
|
1324
|
+
|
1325
|
+
<li>
|
1326
|
+
|
1327
|
+
<span class='name'>value</span>
|
1328
|
+
|
1329
|
+
|
1330
|
+
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1331
|
+
|
1332
|
+
|
1333
|
+
|
1334
|
+
—
|
1335
|
+
<div class='inline'><p>The value to check.</p>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
</li>
|
1339
|
+
|
1340
|
+
<li>
|
1341
|
+
|
1342
|
+
<span class='name'>format</span>
|
1343
|
+
|
1344
|
+
|
1345
|
+
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
|
1346
|
+
|
1347
|
+
|
1348
|
+
<em class="default">(defaults to: <tt>"%F %T"</tt>)</em>
|
1349
|
+
|
1350
|
+
|
1351
|
+
—
|
1352
|
+
<div class='inline'><p>The format to check the value against.</p>
|
1353
|
+
</div>
|
1354
|
+
|
1355
|
+
</li>
|
1356
|
+
|
1357
|
+
</ul>
|
1358
|
+
|
1359
|
+
<p class="tag_title">Returns:</p>
|
1360
|
+
<ul class="return">
|
1361
|
+
|
1362
|
+
<li>
|
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
|
+
|
1369
|
+
—
|
1370
|
+
<div class='inline'><p><code>true</code> if the value is valid against the format, <code>false</code> otherwise.</p>
|
1371
|
+
</div>
|
1372
|
+
|
1373
|
+
</li>
|
1374
|
+
|
1375
|
+
</ul>
|
1376
|
+
|
1377
|
+
<p class="tag_title">See Also:</p>
|
1378
|
+
<ul class="see">
|
1379
|
+
|
1380
|
+
<li>DateTime#custom_format</li>
|
1381
|
+
|
1382
|
+
</ul>
|
1383
|
+
|
1384
|
+
</div><table class="source_code">
|
1385
|
+
<tr>
|
1386
|
+
<td>
|
1387
|
+
<pre class="lines">
|
1388
|
+
|
1389
|
+
|
1390
|
+
149
|
1391
|
+
150
|
1392
|
+
151
|
1393
|
+
152
|
1394
|
+
153
|
1395
|
+
154</pre>
|
1396
|
+
</td>
|
1397
|
+
<td>
|
1398
|
+
<pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 149</span>
|
1399
|
+
|
1400
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_valid?'>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>
|
1401
|
+
<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='comma'>,</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>
|
1402
|
+
<span class='kw'>true</span>
|
1403
|
+
<span class='kw'>rescue</span>
|
1404
|
+
<span class='kw'>false</span>
|
1393
1405
|
<span class='kw'>end</span></pre>
|
1394
1406
|
</td>
|
1395
1407
|
</tr>
|
@@ -1542,9 +1554,9 @@ Date.years(1, true, 2010, true)
|
|
1542
1554
|
</div>
|
1543
1555
|
|
1544
1556
|
<div id="footer">
|
1545
|
-
Generated on Sun
|
1557
|
+
Generated on Sun Apr 27 17:16:42 2014 by
|
1546
1558
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1547
|
-
0.8.7.
|
1559
|
+
0.8.7.4 (ruby-2.1.0).
|
1548
1560
|
</div>
|
1549
1561
|
|
1550
1562
|
</body>
|