doc/Lazier/DateTime/ClassMethods.html in lazier-3.5.7 vs doc/Lazier/DateTime/ClassMethods.html in lazier-4.0.0
- old
+ new
@@ -179,56 +179,10 @@
<li class="public ">
<span class="summary_signature">
- <a href="#find_timezone-instance_method" title="#find_timezone (instance method)">- (TimeZone) <strong>find_timezone</strong>(name = true, dst_label = nil) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Find a zone by its name.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#list_timezones-instance_method" title="#list_timezones (instance method)">- (Array) <strong>list_timezones</strong>(with_dst = true, dst_label = nil) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Returns a list of names of all timezones.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
<a href="#months-instance_method" title="#months (instance method)">- (Array) <strong>months</strong>(short = true) </a>
</span>
@@ -248,108 +202,14 @@
<li class="public ">
<span class="summary_signature">
- <a href="#parameterize_zone-instance_method" title="#parameterize_zone (instance method)">- (String) <strong>parameterize_zone</strong>(tz, with_offset = true) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Returns a string representation of a timezone.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#rationalize_offset-instance_method" title="#rationalize_offset (instance method)">- (Rational) <strong>rationalize_offset</strong>(offset) </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Returns an offset in rational value.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#timezones-instance_method" title="#timezones (instance method)">- (Array) <strong>timezones</strong> </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Returns all the availabe timezones.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
- <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>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'><p>Finds a parameterized timezone.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
<a href="#valid%3F-instance_method" title="#valid? (instance method)">- (Boolean) <strong>valid?</strong>(value, format = "%F %T") </a>
- (also: #is_valid?)
-
</span>
@@ -365,11 +225,11 @@
<li class="public ">
<span class="summary_signature">
- <a href="#years-instance_method" title="#years (instance method)">- (Array) <strong>years</strong>(offset = 10, also_future = true, reference = nil, as_objects = false) </a>
+ <a href="#years-instance_method" title="#years (instance method)">- (Array) <strong>years</strong>(offset: 10, also_future: true, reference: nil, as_objects: false) </a>
</span>
@@ -462,16 +322,16 @@
<tr>
<td>
<pre class="lines">
-139
-140
-141</pre>
+63
+64
+65</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 139</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 63</span>
<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>
<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='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
@@ -547,18 +407,18 @@
<tr>
<td>
<pre class="lines">
+18
19
20
21
-22
-23</pre>
+22</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 19</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 18</span>
<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>
<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><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='period'>.</span><span class='id identifier rubyid_with_index'>with_index</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
<span class='lbrace'>{</span><span class='label'>value:</span> <span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</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_label'>label</span><span class='rbrace'>}</span>
<span class='rbrace'>}</span>
@@ -636,28 +496,28 @@
<tr>
<td>
<pre class="lines">
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132</pre>
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 121</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 85</span>
<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>
- <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>
+ <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_integer?'>integer?</span>
<span class='comment'># Compute using Anonymous Gregorian Algorithm: http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm
</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>
<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>
<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>
@@ -670,200 +530,10 @@
</tr>
</table>
</div>
<div class="method_details ">
- <h3 class="signature " id="find_timezone-instance_method">
-
- - (<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)
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Find a zone by its name.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
-
- <li>
-
- <span class='name'>name</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>true</tt>)</em>
-
-
- —
- <div class='inline'><p>The zone name.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>dst_label</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>nil</tt>)</em>
-
-
- —
- <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>)</span>
-
-
-
- —
- <div class='inline'><p>A timezone or <code>nil</code> if no zone was found.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-80
-81
-82</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 80</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <h3 class="signature " id="list_timezones-instance_method">
-
- - (<tt>Array</tt>) <strong>list_timezones</strong>(with_dst = true, dst_label = nil)
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Returns a list of names of all timezones.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
-
- <li>
-
- <span class='name'>with_dst</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>true</tt>)</em>
-
-
- —
- <div class='inline'><p>If include DST version of the zones.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>dst_label</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>nil</tt>)</em>
-
-
- —
- <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt>Array</tt>)</span>
-
-
-
- —
- <div class='inline'><p>A list of names of timezones.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-71
-72
-73</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 71</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
<h3 class="signature " id="months-instance_method">
- (<tt>Array</tt>) <strong>months</strong>(short = true)
@@ -929,18 +599,18 @@
<tr>
<td>
<pre class="lines">
+29
30
31
32
-33
-34</pre>
+33</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 30</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 29</span>
<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>
<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><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='period'>.</span><span class='id identifier rubyid_with_index'>with_index</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
<span class='lbrace'>{</span><span class='label'>value:</span> <span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</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_label'>label</span><span class='rbrace'>}</span>
<span class='rbrace'>}</span>
@@ -949,368 +619,16 @@
</tr>
</table>
</div>
<div class="method_details ">
- <h3 class="signature " id="parameterize_zone-instance_method">
-
- - (<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)
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Returns a string representation of a timezone.</p>
-
-<p><code>ruby
-DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US & Canada)"])
-# => "-0800@pacific-time-us-canada"
-</code></p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
-
- <li>
-
- <span class='name'>tz</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../TimeZone.html" title="Lazier::TimeZone (module)">TimeZone</a></span></tt>)</span>
-
-
-
- —
- <div class='inline'><p>The zone to represent.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>with_offset</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>true</tt>)</em>
-
-
- —
- <div class='inline'><p>If to include offset into the representation.</p>
-</div>
-
- </li>
-
-</ul>
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
-
- —
- <div class='inline'><p>A string representation which can be used for searches.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-93
-94
-95</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 93</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <h3 class="signature " id="rationalize_offset-instance_method">
-
- - (<tt>Rational</tt>) <strong>rationalize_offset</strong>(offset)
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Returns an offset in rational value.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
-
- <li>
-
- <span class='name'>offset</span>
-
-
- <span class='type'>(<tt>Fixnum</tt>)</span>
-
-
-
- —
- <div class='inline'><p>The offset to convert.</p>
-</div>
-
- </li>
-
-</ul>
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt>Rational</tt>)</span>
-
-
-
- —
- <div class='inline'><p>The converted offset.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-112
-113
-114</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 112</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <h3 class="signature " id="timezones-instance_method">
-
- - (<tt>Array</tt>) <strong>timezones</strong>
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Returns all the availabe timezones.</p>
-
-
- </div>
-</div>
-<div class="tags">
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt>Array</tt>)</span>
-
-
-
- —
- <div class='inline'><p>All the zone available.</p>
-</div>
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-62
-63
-64</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 62</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_timezones'>timezones</span>
- <span class='op'>::</span><span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>TimeZone</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <h3 class="signature " id="unparameterize_zone-instance_method">
-
- - (<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)
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
- <p>Finds a parameterized timezone.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
-<ul class="param">
-
- <li>
-
- <span class='name'>tz</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
-
- —
- <div class='inline'><p>The zone to unparameterize.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>as_string</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>false</tt>)</em>
-
-
- —
- <div class='inline'><p>If return just the zone name.</p>
-</div>
-
- </li>
-
- <li>
-
- <span class='name'>dst_label</span>
-
-
- <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
-
-
- <em class="default">(defaults to: <tt>nil</tt>)</em>
-
-
- —
- <div class='inline'><p>Label for the DST indication. Defaults to <code>(DST)</code>.</p>
-</div>
-
- </li>
-
-</ul>
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <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>
-
-
-
- —
- <div class='inline'><p>The found timezone or <code>nil</code> if the zone is not valid.</p>
-</div>
-
- </li>
-
-</ul>
-
- <p class="tag_title">See Also:</p>
- <ul class="see">
-
- <li>DateTime#parameterize_zone</li>
-
- </ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-104
-105
-106</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 104</span>
-
-<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>
- <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>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
<h3 class="signature " id="valid?-instance_method">
- (<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>valid?</strong>(value, format = "%F %T")
- <span class="aliases">Also known as:
- <span class="names"><span id='is_valid?-instance_method'>is_valid?</span></span>
- </span>
-
</h3><div class="docstring">
<div class="discussion">
<p>Checks if the date is valid against to a specific format.</p>
@@ -1385,19 +703,19 @@
<tr>
<td>
<pre class="lines">
-149
-150
-151
-152
-153
-154</pre>
+73
+74
+75
+76
+77
+78</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 149</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 73</span>
<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>
<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>
<span class='kw'>true</span>
<span class='kw'>rescue</span>
@@ -1409,11 +727,11 @@
</div>
<div class="method_details ">
<h3 class="signature " id="years-instance_method">
- - (<tt>Array</tt>) <strong>years</strong>(offset = 10, also_future = true, reference = nil, as_objects = false)
+ - (<tt>Array</tt>) <strong>years</strong>(offset: 10, also_future: true, reference: nil, as_objects: false)
@@ -1444,13 +762,11 @@
<span class='type'>(<tt>Fixnum</tt>)</span>
- <em class="default">(defaults to: <tt>10</tt>)</em>
-
—
<div class='inline'><p>The width of the range.</p>
</div>
</li>
@@ -1461,13 +777,11 @@
<span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
- <em class="default">(defaults to: <tt>true</tt>)</em>
-
—
<div class='inline'><p>If return also future years.</p>
</div>
</li>
@@ -1478,13 +792,11 @@
<span class='type'>(<tt>Fixnum</tt>)</span>
- <em class="default">(defaults to: <tt>nil</tt>)</em>
-
—
<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>
</div>
</li>
@@ -1495,13 +807,11 @@
<span class='type'>(<tt><span class='object_link'><a href="../Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
- <em class="default">(defaults to: <tt>false</tt>)</em>
-
—
<div class='inline'><p>If to return years in hashes with <code>:value</code> and <code>label</code> keys.</p>
</div>
</li>
@@ -1530,19 +840,19 @@
<tr>
<td>
<pre class="lines">
+53
54
55
-56
-57</pre>
+56</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 54</span>
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 53</span>
-<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>
+<span class='kw'>def</span> <span class='id identifier rubyid_years'>years</span><span class='lparen'>(</span><span class='label'>offset:</span> <span class='int'>10</span><span class='comma'>,</span> <span class='label'>also_future:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>reference:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>as_objects:</span> <span class='kw'>false</span><span class='rparen'>)</span>
<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>
<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_map'>map</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>
<span class='kw'>end</span></pre>
</td>
</tr>
@@ -1552,10 +862,10 @@
</div>
</div>
<div id="footer">
- Generated on Thu Jun 19 11:49:05 2014 by
+ Generated on Sun Jun 1 15:50:06 2014 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.4 (ruby-2.1.2).
</div>
</body>
\ No newline at end of file