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,297 @@
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::Boolean
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 (B)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Lazier.html" title="Lazier (module)">Lazier</a></span></span>
36
+ &raquo;
37
+ <span class="title">Boolean</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::Boolean
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+ <dt class="r1">Extended by:</dt>
77
+ <dd class="r1">ActiveSupport::Concern</dd>
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/lazier/boolean.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+ <p>Extension for the boolean values.</p>
94
+
95
+
96
+ </div>
97
+ </div>
98
+ <div class="tags">
99
+
100
+
101
+ </div>
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <h2>
110
+ Instance Method Summary
111
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
112
+ </h2>
113
+
114
+ <ul class="summary">
115
+
116
+ <li class="public ">
117
+ <span class="summary_signature">
118
+
119
+ <a href="#to_i-instance_method" title="#to_i (instance method)">- (Fixnum) <strong>to_i</strong> </a>
120
+
121
+
122
+
123
+ </span>
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <span class="summary_desc"><div class='inline'><p>Converts the boolean to an integer.</p>
134
+ </div></span>
135
+
136
+ </li>
137
+
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#value-instance_method" title="#value (instance method)">- (Boolean) <strong>value</strong> </a>
143
+
144
+
145
+
146
+ </span>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'><p>Returns the boolean itself for use in form helpers.</p>
157
+ </div></span>
158
+
159
+ </li>
160
+
161
+
162
+ </ul>
163
+
164
+
165
+
166
+
167
+
168
+ <div id="instance_method_details" class="method_details_list">
169
+ <h2>Instance Method Details</h2>
170
+
171
+
172
+ <div class="method_details first">
173
+ <h3 class="signature first" id="to_i-instance_method">
174
+
175
+ - (<tt>Fixnum</tt>) <strong>to_i</strong>
176
+
177
+
178
+
179
+
180
+
181
+ </h3><div class="docstring">
182
+ <div class="discussion">
183
+ <p>Converts the boolean to an integer.</p>
184
+
185
+
186
+ </div>
187
+ </div>
188
+ <div class="tags">
189
+
190
+ <p class="tag_title">Returns:</p>
191
+ <ul class="return">
192
+
193
+ <li>
194
+
195
+
196
+ <span class='type'>(<tt>Fixnum</tt>)</span>
197
+
198
+
199
+
200
+ &mdash;
201
+ <div class='inline'><p><code>1</code> for <code>true</code>, <code>0</code> for <code>false</code>.</p>
202
+ </div>
203
+
204
+ </li>
205
+
206
+ </ul>
207
+
208
+ </div><table class="source_code">
209
+ <tr>
210
+ <td>
211
+ <pre class="lines">
212
+
213
+
214
+ 15
215
+ 16
216
+ 17</pre>
217
+ </td>
218
+ <td>
219
+ <pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 15</span>
220
+
221
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
222
+ <span class='lparen'>(</span><span class='kw'>self</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span>
223
+ <span class='kw'>end</span></pre>
224
+ </td>
225
+ </tr>
226
+ </table>
227
+ </div>
228
+
229
+ <div class="method_details ">
230
+ <h3 class="signature " id="value-instance_method">
231
+
232
+ - (<tt><span class='object_link'><a href="" title="Lazier::Boolean (module)">Boolean</a></span></tt>) <strong>value</strong>
233
+
234
+
235
+
236
+
237
+
238
+ </h3><div class="docstring">
239
+ <div class="discussion">
240
+ <p>Returns the boolean itself for use in form helpers.</p>
241
+
242
+
243
+ </div>
244
+ </div>
245
+ <div class="tags">
246
+
247
+ <p class="tag_title">Returns:</p>
248
+ <ul class="return">
249
+
250
+ <li>
251
+
252
+
253
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
254
+
255
+
256
+
257
+ &mdash;
258
+ <div class='inline'><p>The boolean value.</p>
259
+ </div>
260
+
261
+ </li>
262
+
263
+ </ul>
264
+
265
+ </div><table class="source_code">
266
+ <tr>
267
+ <td>
268
+ <pre class="lines">
269
+
270
+
271
+ 22
272
+ 23
273
+ 24</pre>
274
+ </td>
275
+ <td>
276
+ <pre class="code"><span class="info file"># File 'lib/lazier/boolean.rb', line 22</span>
277
+
278
+ <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
279
+ <span class='kw'>self</span>
280
+ <span class='kw'>end</span></pre>
281
+ </td>
282
+ </tr>
283
+ </table>
284
+ </div>
285
+
286
+ </div>
287
+
288
+ </div>
289
+
290
+ <div id="footer">
291
+ Generated on Wed Aug 1 08:57:55 2012 by
292
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
293
+ 0.8.2.1 (ruby-1.9.2).
294
+ </div>
295
+
296
+ </body>
297
+ </html>
@@ -0,0 +1,787 @@
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
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 (D)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Lazier.html" title="Lazier (module)">Lazier</a></span></span>
36
+ &raquo;
37
+ <span class="title">DateTime</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
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+ <dt class="r1">Extended by:</dt>
77
+ <dd class="r1">ActiveSupport::Concern</dd>
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/lazier/datetime.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+ <p>Extensions for date and time objects.</p>
94
+
95
+
96
+ </div>
97
+ </div>
98
+ <div class="tags">
99
+
100
+
101
+ </div><h2>Defined Under Namespace</h2>
102
+ <p class="children">
103
+
104
+
105
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="DateTime/ClassMethods.html" title="Lazier::DateTime::ClassMethods (module)">ClassMethods</a></span>
106
+
107
+
108
+
109
+
110
+ </p>
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <h2>
120
+ Instance Method Summary
121
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
122
+ </h2>
123
+
124
+ <ul class="summary">
125
+
126
+ <li class="public ">
127
+ <span class="summary_signature">
128
+
129
+ <a href="#in_months-instance_method" title="#in_months (instance method)">- (Fixnum) <strong>in_months</strong>(base = nil) </a>
130
+
131
+
132
+
133
+ </span>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'><p>Returns the number of months passed between the beginning of the base year and the current date.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#local_lstrftime-instance_method" title="#local_lstrftime (instance method)">- (String) <strong>local_lstrftime</strong>(format = nil) </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ <span class="summary_desc"><div class='inline'><p>Formats a datetime in the current timezone, looking up also custom formats.</p>
167
+ </div></span>
168
+
169
+ </li>
170
+
171
+
172
+ <li class="public ">
173
+ <span class="summary_signature">
174
+
175
+ <a href="#local_strftime-instance_method" title="#local_strftime (instance method)">- (String) <strong>local_strftime</strong>(format = nil) </a>
176
+
177
+
178
+
179
+ </span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'><p>Formats a datetime in the current timezone.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#lstrftime-instance_method" title="#lstrftime (instance method)">- (String) <strong>lstrftime</strong>(format = nil) </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'><p>Formats a datetime, looking up also custom formats.</p>
213
+ </div></span>
214
+
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#padded_month-instance_method" title="#padded_month (instance method)">- (String) <strong>padded_month</strong> </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'><p>Returns the current month number with leading 0.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#utc_time-instance_method" title="#utc_time (instance method)">- (UTC::Time) <strong>utc_time</strong> </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ <span class="summary_desc"><div class='inline'><p>Returns the UTC::Time representation of the current datetime.</p>
259
+ </div></span>
260
+
261
+ </li>
262
+
263
+
264
+ </ul>
265
+
266
+
267
+
268
+
269
+
270
+ <div id="instance_method_details" class="method_details_list">
271
+ <h2>Instance Method Details</h2>
272
+
273
+
274
+ <div class="method_details first">
275
+ <h3 class="signature first" id="in_months-instance_method">
276
+
277
+ - (<tt>Fixnum</tt>) <strong>in_months</strong>(base = nil)
278
+
279
+
280
+
281
+
282
+
283
+ </h3><div class="docstring">
284
+ <div class="discussion">
285
+ <p>Returns the number of months passed between the beginning of the base year and the current date.</p>
286
+
287
+ <pre class="code ruby"><code><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_civil'>civil</span><span class='lparen'>(</span><span class='int'>2012</span><span class='comma'>,</span> <span class='int'>6</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_in_months'>in_months</span><span class='lparen'>(</span><span class='int'>2011</span><span class='rparen'>)</span>
288
+ <span class='comment'># =&gt; 18
289
+ </span></code></pre>
290
+
291
+
292
+ </div>
293
+ </div>
294
+ <div class="tags">
295
+ <p class="tag_title">Parameters:</p>
296
+ <ul class="param">
297
+
298
+ <li>
299
+
300
+ <span class='name'>base</span>
301
+
302
+
303
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Lazier::DateTime (module)">DateTime</a></span></tt>)</span>
304
+
305
+
306
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
307
+
308
+
309
+ &mdash;
310
+ <div class='inline'><p>The base year to start computation from. Default to current year.</p>
311
+ </div>
312
+
313
+ </li>
314
+
315
+ </ul>
316
+
317
+ <p class="tag_title">Returns:</p>
318
+ <ul class="return">
319
+
320
+ <li>
321
+
322
+
323
+ <span class='type'>(<tt>Fixnum</tt>)</span>
324
+
325
+
326
+
327
+ &mdash;
328
+ <div class='inline'><p>Returns the number of months passed between the beginning of the base year and the current date.</p>
329
+ </div>
330
+
331
+ </li>
332
+
333
+ </ul>
334
+
335
+ </div><table class="source_code">
336
+ <tr>
337
+ <td>
338
+ <pre class="lines">
339
+
340
+
341
+ 193
342
+ 194
343
+ 195
344
+ 196</pre>
345
+ </td>
346
+ <td>
347
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 193</span>
348
+
349
+ <span class='kw'>def</span> <span class='id identifier rubyid_in_months'>in_months</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
350
+ <span class='id identifier rubyid_base'>base</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_today'>today</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span>
351
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='int'>12</span> <span class='op'>+</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span>
352
+ <span class='kw'>end</span></pre>
353
+ </td>
354
+ </tr>
355
+ </table>
356
+ </div>
357
+
358
+ <div class="method_details ">
359
+ <h3 class="signature " id="local_lstrftime-instance_method">
360
+
361
+ - (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>local_lstrftime</strong>(format = nil)
362
+
363
+
364
+
365
+
366
+
367
+ </h3><div class="docstring">
368
+ <div class="discussion">
369
+ <p>Formats a datetime in the current timezone, looking up also custom formats.</p>
370
+
371
+
372
+ </div>
373
+ </div>
374
+ <div class="tags">
375
+ <p class="tag_title">Parameters:</p>
376
+ <ul class="param">
377
+
378
+ <li>
379
+
380
+ <span class='name'>format</span>
381
+
382
+
383
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
384
+
385
+
386
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
387
+
388
+
389
+ &mdash;
390
+ <div class='inline'><p>A format or a custom format name.</p>
391
+ </div>
392
+
393
+ </li>
394
+
395
+ </ul>
396
+
397
+ <p class="tag_title">Returns:</p>
398
+ <ul class="return">
399
+
400
+ <li>
401
+
402
+
403
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
404
+
405
+
406
+
407
+ &mdash;
408
+ <div class='inline'><p>The formatted date.</p>
409
+ </div>
410
+
411
+ </li>
412
+
413
+ </ul>
414
+
415
+ <p class="tag_title">See Also:</p>
416
+ <ul class="see">
417
+
418
+ <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>
419
+
420
+ </ul>
421
+
422
+ </div><table class="source_code">
423
+ <tr>
424
+ <td>
425
+ <pre class="lines">
426
+
427
+
428
+ 254
429
+ 255
430
+ 256</pre>
431
+ </td>
432
+ <td>
433
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 254</span>
434
+
435
+ <span class='kw'>def</span> <span class='id identifier rubyid_local_lstrftime'>local_lstrftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
436
+ <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:in_time_zone</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_time_zone'>in_time_zone</span> <span class='op'>:</span> <span class='kw'>self</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_lstrftime'>lstrftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
437
+ <span class='kw'>end</span></pre>
438
+ </td>
439
+ </tr>
440
+ </table>
441
+ </div>
442
+
443
+ <div class="method_details ">
444
+ <h3 class="signature " id="local_strftime-instance_method">
445
+
446
+ - (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>local_strftime</strong>(format = nil)
447
+
448
+
449
+
450
+
451
+
452
+ </h3><div class="docstring">
453
+ <div class="discussion">
454
+ <p>Formats a datetime in the current timezone.</p>
455
+
456
+
457
+ </div>
458
+ </div>
459
+ <div class="tags">
460
+ <p class="tag_title">Parameters:</p>
461
+ <ul class="param">
462
+
463
+ <li>
464
+
465
+ <span class='name'>format</span>
466
+
467
+
468
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
469
+
470
+
471
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
472
+
473
+
474
+ &mdash;
475
+ <div class='inline'><p>The format to use for formatting.</p>
476
+ </div>
477
+
478
+ </li>
479
+
480
+ </ul>
481
+
482
+ <p class="tag_title">Returns:</p>
483
+ <ul class="return">
484
+
485
+ <li>
486
+
487
+
488
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
489
+
490
+
491
+
492
+ &mdash;
493
+ <div class='inline'><p>The formatted date.</p>
494
+ </div>
495
+
496
+ </li>
497
+
498
+ </ul>
499
+
500
+ </div><table class="source_code">
501
+ <tr>
502
+ <td>
503
+ <pre class="lines">
504
+
505
+
506
+ 245
507
+ 246
508
+ 247</pre>
509
+ </td>
510
+ <td>
511
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 245</span>
512
+
513
+ <span class='kw'>def</span> <span class='id identifier rubyid_local_strftime'>local_strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
514
+ <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:in_time_zone</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_time_zone'>in_time_zone</span> <span class='op'>:</span> <span class='kw'>self</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rparen'>)</span>
515
+ <span class='kw'>end</span></pre>
516
+ </td>
517
+ </tr>
518
+ </table>
519
+ </div>
520
+
521
+ <div class="method_details ">
522
+ <h3 class="signature " id="lstrftime-instance_method">
523
+
524
+ - (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>lstrftime</strong>(format = nil)
525
+
526
+
527
+
528
+
529
+
530
+ </h3><div class="docstring">
531
+ <div class="discussion">
532
+ <p>Formats a datetime, looking up also custom formats.</p>
533
+
534
+
535
+ </div>
536
+ </div>
537
+ <div class="tags">
538
+ <p class="tag_title">Parameters:</p>
539
+ <ul class="param">
540
+
541
+ <li>
542
+
543
+ <span class='name'>format</span>
544
+
545
+
546
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
547
+
548
+
549
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
550
+
551
+
552
+ &mdash;
553
+ <div class='inline'><p>A format or a custom format name to use for formatting.</p>
554
+ </div>
555
+
556
+ </li>
557
+
558
+ </ul>
559
+
560
+ <p class="tag_title">Returns:</p>
561
+ <ul class="return">
562
+
563
+ <li>
564
+
565
+
566
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
567
+
568
+
569
+
570
+ &mdash;
571
+ <div class='inline'><p>The formatted date.</p>
572
+ </div>
573
+
574
+ </li>
575
+
576
+ </ul>
577
+
578
+ <p class="tag_title">See Also:</p>
579
+ <ul class="see">
580
+
581
+ <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>
582
+
583
+ </ul>
584
+
585
+ </div><table class="source_code">
586
+ <tr>
587
+ <td>
588
+ <pre class="lines">
589
+
590
+
591
+ 210
592
+ 211
593
+ 212
594
+ 213
595
+ 214
596
+ 215
597
+ 216
598
+ 217
599
+ 218
600
+ 219
601
+ 220
602
+ 221
603
+ 222
604
+ 223
605
+ 224
606
+ 225
607
+ 226
608
+ 227
609
+ 228
610
+ 229
611
+ 230
612
+ 231
613
+ 232
614
+ 233
615
+ 234
616
+ 235
617
+ 236
618
+ 237
619
+ 238
620
+ 239</pre>
621
+ </td>
622
+ <td>
623
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 210</span>
624
+
625
+ <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>
626
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
627
+ <span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_settings'>settings</span><span class='period'>.</span><span class='id identifier rubyid_date_names'>date_names</span>
628
+
629
+ <span class='id identifier rubyid_final_format'>final_format</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_custom_format'>custom_format</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(%{1,2}:?[abz])</span><span class='regexp_end'>/i</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span>
630
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='id identifier rubyid_match'>match</span>
631
+
632
+ <span class='comment'># Handling of %z is to fix ruby 1.8 bug in OSX: http://bugs.ruby-lang.org/issues/2396
633
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span> <span class='op'>!~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^%%</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span>
634
+ <span class='kw'>case</span> <span class='id identifier rubyid_match'>match</span>
635
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%a</span><span class='tstring_end'>&quot;</span></span>
636
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:short_days</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wday'>wday</span><span class='rbracket'>]</span>
637
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%A</span><span class='tstring_end'>&quot;</span></span>
638
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:long_days</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wday'>wday</span><span class='rbracket'>]</span>
639
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%b</span><span class='tstring_end'>&quot;</span></span>
640
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:short_months</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span>
641
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%B</span><span class='tstring_end'>&quot;</span></span>
642
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='symbol'>:long_months</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span>
643
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%z</span><span class='tstring_end'>&quot;</span></span>
644
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_is_ruby_18?'>is_ruby_18?</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_formatted_offset'>formatted_offset</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
645
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%:z</span><span class='tstring_end'>&quot;</span></span>
646
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_is_ruby_18?'>is_ruby_18?</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_formatted_offset'>formatted_offset</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
647
+ <span class='kw'>end</span>
648
+ <span class='kw'>end</span>
649
+
650
+ <span class='id identifier rubyid_mrv'>mrv</span> <span class='op'>?</span> <span class='id identifier rubyid_mrv'>mrv</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%%</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_match'>match</span>
651
+ <span class='kw'>end</span>
652
+
653
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_final_format'>final_format</span><span class='rparen'>)</span>
654
+ <span class='kw'>end</span></pre>
655
+ </td>
656
+ </tr>
657
+ </table>
658
+ </div>
659
+
660
+ <div class="method_details ">
661
+ <h3 class="signature " id="padded_month-instance_method">
662
+
663
+ - (<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>) <strong>padded_month</strong>
664
+
665
+
666
+
667
+
668
+
669
+ </h3><div class="docstring">
670
+ <div class="discussion">
671
+ <p>Returns the current month number with leading 0.</p>
672
+
673
+
674
+ </div>
675
+ </div>
676
+ <div class="tags">
677
+
678
+ <p class="tag_title">Returns:</p>
679
+ <ul class="return">
680
+
681
+ <li>
682
+
683
+
684
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
685
+
686
+
687
+
688
+ &mdash;
689
+ <div class='inline'><p>The current month number with leading 0.</p>
690
+ </div>
691
+
692
+ </li>
693
+
694
+ </ul>
695
+
696
+ </div><table class="source_code">
697
+ <tr>
698
+ <td>
699
+ <pre class="lines">
700
+
701
+
702
+ 201
703
+ 202
704
+ 203</pre>
705
+ </td>
706
+ <td>
707
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 201</span>
708
+
709
+ <span class='kw'>def</span> <span class='id identifier rubyid_padded_month'>padded_month</span>
710
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
711
+ <span class='kw'>end</span></pre>
712
+ </td>
713
+ </tr>
714
+ </table>
715
+ </div>
716
+
717
+ <div class="method_details ">
718
+ <h3 class="signature " id="utc_time-instance_method">
719
+
720
+ - (<tt>UTC::Time</tt>) <strong>utc_time</strong>
721
+
722
+
723
+
724
+
725
+
726
+ </h3><div class="docstring">
727
+ <div class="discussion">
728
+ <p>Returns the UTC::Time representation of the current datetime.</p>
729
+
730
+
731
+ </div>
732
+ </div>
733
+ <div class="tags">
734
+
735
+ <p class="tag_title">Returns:</p>
736
+ <ul class="return">
737
+
738
+ <li>
739
+
740
+
741
+ <span class='type'>(<tt>UTC::Time</tt>)</span>
742
+
743
+
744
+
745
+ &mdash;
746
+ <div class='inline'><p>The UTC::Time representation of the current datetime.</p>
747
+ </div>
748
+
749
+ </li>
750
+
751
+ </ul>
752
+
753
+ </div><table class="source_code">
754
+ <tr>
755
+ <td>
756
+ <pre class="lines">
757
+
758
+
759
+ 179
760
+ 180
761
+ 181
762
+ 182</pre>
763
+ </td>
764
+ <td>
765
+ <pre class="code"><span class="info file"># File 'lib/lazier/datetime.rb', line 179</span>
766
+
767
+ <span class='kw'>def</span> <span class='id identifier rubyid_utc_time'>utc_time</span>
768
+ <span class='id identifier rubyid_ua'>ua</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:utc</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_datetime'>to_datetime</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span>
769
+ <span class='op'>::</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='lparen'>(</span><span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_year'>year</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_month'>month</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_day'>day</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_hour'>hour</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_ua'>ua</span><span class='period'>.</span><span class='id identifier rubyid_sec'>sec</span><span class='rparen'>)</span>
770
+ <span class='kw'>end</span></pre>
771
+ </td>
772
+ </tr>
773
+ </table>
774
+ </div>
775
+
776
+ </div>
777
+
778
+ </div>
779
+
780
+ <div id="footer">
781
+ Generated on Wed Aug 1 08:57:55 2012 by
782
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
783
+ 0.8.2.1 (ruby-1.9.2).
784
+ </div>
785
+
786
+ </body>
787
+ </html>