lazier 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -16,5 +16,5 @@ gem "rake", "~> 10.0.3"
16
16
  gem "simplecov", ">= 0.7.1"
17
17
  gem "pry", ">= 0"
18
18
  gem "yard", ">= 0.8.5"
19
- gem "kramdown", ">= 0.14.2"
19
+ gem "kramdown", ">= 1.0.1"
20
20
  gem "github-markup", ">= 0.7.5"
data/doc/Lazier.html CHANGED
@@ -127,6 +127,29 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
127
127
  <li class="public ">
128
128
  <span class="summary_signature">
129
129
 
130
+ <a href="#find_class-class_method" title="find_class (class method)">+ (Class) <strong>find_class</strong>(cls, scope = &quot;::%CLASS%&quot;, only_in_scope = false) </a>
131
+
132
+
133
+
134
+ </span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'><p>Finds a class to instantiate.</p>
145
+ </div></span>
146
+
147
+ </li>
148
+
149
+
150
+ <li class="public ">
151
+ <span class="summary_signature">
152
+
130
153
  <a href="#load%21-class_method" title="load! (class method)">+ (Settings) <strong>load!</strong>(*what) </a>
131
154
 
132
155
 
@@ -341,7 +364,145 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
341
364
 
342
365
 
343
366
  <div class="method_details first">
344
- <h3 class="signature first" id="load!-class_method">
367
+ <h3 class="signature first" id="find_class-class_method">
368
+
369
+ + (<tt>Class</tt>) <strong>find_class</strong>(cls, scope = &quot;::%CLASS%&quot;, only_in_scope = false)
370
+
371
+
372
+
373
+
374
+
375
+ </h3><div class="docstring">
376
+ <div class="discussion">
377
+ <p>Finds a class to instantiate.</p>
378
+
379
+
380
+ </div>
381
+ </div>
382
+ <div class="tags">
383
+ <p class="tag_title">Parameters:</p>
384
+ <ul class="param">
385
+
386
+ <li>
387
+
388
+ <span class='name'>cls</span>
389
+
390
+
391
+ <span class='type'>(<tt>Symbol|<span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span>|<span class='object_link'><a href="Lazier/Object.html" title="Lazier::Object (module)">Object</a></span></tt>)</span>
392
+
393
+
394
+
395
+ &mdash;
396
+ <div class='inline'><p>If a <code>String</code> or a <code>Symbol</code> or a <code>Class</code>, then it will be the class to instantiate. Otherwise the class of the object will returned.</p>
397
+ </div>
398
+
399
+ </li>
400
+
401
+ <li>
402
+
403
+ <span class='name'>scope</span>
404
+
405
+
406
+ <span class='type'>(<tt><span class='object_link'><a href="Lazier/String.html" title="Lazier::String (module)">String</a></span></tt>)</span>
407
+
408
+
409
+ <em class="default">(defaults to: <tt>&quot;::%CLASS%&quot;</tt>)</em>
410
+
411
+
412
+ &mdash;
413
+ <div class='inline'><p>An additional scope to find the class. <code>%CLASS%</code> will be substituted with the class name.</p>
414
+ </div>
415
+
416
+ </li>
417
+
418
+ <li>
419
+
420
+ <span class='name'>only_in_scope</span>
421
+
422
+
423
+ <span class='type'>(<tt><span class='object_link'><a href="Lazier/Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span>
424
+
425
+
426
+ <em class="default">(defaults to: <tt>false</tt>)</em>
427
+
428
+
429
+ &mdash;
430
+ <div class='inline'><p>If only try to instantiate the class in the scope.</p>
431
+ </div>
432
+
433
+ </li>
434
+
435
+ </ul>
436
+
437
+ <p class="tag_title">Returns:</p>
438
+ <ul class="return">
439
+
440
+ <li>
441
+
442
+
443
+ <span class='type'>(<tt>Class</tt>)</span>
444
+
445
+
446
+
447
+ &mdash;
448
+ <div class='inline'><p>The found class.</p>
449
+ </div>
450
+
451
+ </li>
452
+
453
+ </ul>
454
+
455
+ </div><table class="source_code">
456
+ <tr>
457
+ <td>
458
+ <pre class="lines">
459
+
460
+
461
+ 128
462
+ 129
463
+ 130
464
+ 131
465
+ 132
466
+ 133
467
+ 134
468
+ 135
469
+ 136
470
+ 137
471
+ 138
472
+ 139
473
+ 140
474
+ 141
475
+ 142
476
+ 143
477
+ 144</pre>
478
+ </td>
479
+ <td>
480
+ <pre class="code"><span class="info file"># File 'lib/lazier.rb', line 128</span>
481
+
482
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find_class'>find_class</span><span class='lparen'>(</span><span class='id identifier rubyid_cls'>cls</span><span class='comma'>,</span> <span class='id identifier rubyid_scope'>scope</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>::%CLASS%</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_only_in_scope'>only_in_scope</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
483
+ <span class='kw'>if</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Symbol</span><span class='rparen'>)</span> <span class='kw'>then</span>
484
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
485
+ <span class='id identifier rubyid_cls'>cls</span> <span class='op'>=</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span>
486
+
487
+ <span class='kw'>if</span> <span class='id identifier rubyid_only_in_scope'>only_in_scope</span> <span class='kw'>then</span>
488
+ <span class='id identifier rubyid_cls'>cls</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'>^::</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='comment'># Mark only search only inside scope
489
+ </span> <span class='kw'>else</span>
490
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_search_class'>search_class</span><span class='lparen'>(</span><span class='id identifier rubyid_cls'>cls</span><span class='rparen'>)</span> <span class='comment'># Search outside scope
491
+ </span> <span class='kw'>end</span>
492
+
493
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_search_class'>search_class</span><span class='lparen'>(</span><span class='id identifier rubyid_scope'>scope</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%CLASS%</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_cls'>cls</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_rv'>rv</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_cls'>cls</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='op'>&amp;&amp;</span> <span class='id identifier rubyid_scope'>scope</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='comment'># Search inside scope
494
+ </span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>NameError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_cls'>cls</span><span class='rparen'>)</span><span class='rparen'>)</span>
495
+ <span class='kw'>else</span>
496
+ <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_cls'>cls</span> <span class='op'>:</span> <span class='id identifier rubyid_cls'>cls</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span>
497
+ <span class='kw'>end</span>
498
+ <span class='kw'>end</span></pre>
499
+ </td>
500
+ </tr>
501
+ </table>
502
+ </div>
503
+
504
+ <div class="method_details ">
505
+ <h3 class="signature " id="load!-class_method">
345
506
 
346
507
  + (<tt><span class='object_link'><a href="Lazier/Settings.html" title="Lazier::Settings (class)">Settings</a></span></tt>) <strong>load!</strong>(*what)
347
508
 
@@ -838,7 +999,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
838
999
  </div>
839
1000
 
840
1001
  <div id="footer">
841
- Generated on Thu Feb 28 08:44:08 2013 by
1002
+ Generated on Sun Mar 24 10:59:43 2013 by
842
1003
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
843
1004
  0.8.5.2 (ruby-1.9.3).
844
1005
  </div>
@@ -288,7 +288,7 @@
288
288
  </div>
289
289
 
290
290
  <div id="footer">
291
- Generated on Thu Feb 28 08:44:09 2013 by
291
+ Generated on Sun Mar 24 10:59:44 2013 by
292
292
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
293
293
  0.8.5.2 (ruby-1.9.3).
294
294
  </div>
@@ -725,7 +725,7 @@ DateTime.civil(2013, 6, 1).in_months(2011)
725
725
  </div>
726
726
 
727
727
  <div id="footer">
728
- Generated on Thu Feb 28 08:44:09 2013 by
728
+ Generated on Sun Mar 24 10:59:44 2013 by
729
729
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
730
730
  0.8.5.2 (ruby-1.9.3).
731
731
  </div>
@@ -1568,7 +1568,7 @@ Date.years(1, true, 2010, true)
1568
1568
  </div>
1569
1569
 
1570
1570
  <div id="footer">
1571
- Generated on Thu Feb 28 08:44:09 2013 by
1571
+ Generated on Sun Mar 24 10:59:44 2013 by
1572
1572
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1573
1573
  0.8.5.2 (ruby-1.9.3).
1574
1574
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu Feb 28 08:44:09 2013 by
119
+ Generated on Sun Mar 24 10:59:45 2013 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
121
  0.8.5.2 (ruby-1.9.3).
122
122
  </div>
@@ -124,7 +124,7 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Thu Feb 28 08:44:10 2013 by
127
+ Generated on Sun Mar 24 10:59:45 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
129
  0.8.5.2 (ruby-1.9.3).
130
130
  </div>
@@ -238,7 +238,7 @@
238
238
  </div>
239
239
 
240
240
  <div id="footer">
241
- Generated on Thu Feb 28 08:44:10 2013 by
241
+ Generated on Sun Mar 24 10:59:45 2013 by
242
242
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
243
243
  0.8.5.2 (ruby-1.9.3).
244
244
  </div>
data/doc/Lazier/Hash.html CHANGED
@@ -376,7 +376,7 @@
376
376
  </div>
377
377
 
378
378
  <div id="footer">
379
- Generated on Thu Feb 28 08:44:08 2013 by
379
+ Generated on Sun Mar 24 10:59:43 2013 by
380
380
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
381
381
  0.8.5.2 (ruby-1.9.3).
382
382
  </div>
data/doc/Lazier/I18n.html CHANGED
@@ -1014,7 +1014,7 @@
1014
1014
  </div>
1015
1015
 
1016
1016
  <div id="footer">
1017
- Generated on Thu Feb 28 08:44:08 2013 by
1017
+ Generated on Sun Mar 24 10:59:43 2013 by
1018
1018
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1019
1019
  0.8.5.2 (ruby-1.9.3).
1020
1020
  </div>
@@ -540,7 +540,7 @@
540
540
  </div>
541
541
 
542
542
  <div id="footer">
543
- Generated on Thu Feb 28 08:44:10 2013 by
543
+ Generated on Sun Mar 24 10:59:45 2013 by
544
544
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
545
545
  0.8.5.2 (ruby-1.9.3).
546
546
  </div>
data/doc/Lazier/Math.html CHANGED
@@ -121,7 +121,7 @@
121
121
  </div>
122
122
 
123
123
  <div id="footer">
124
- Generated on Thu Feb 28 08:44:08 2013 by
124
+ Generated on Sun Mar 24 10:59:44 2013 by
125
125
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
126
  0.8.5.2 (ruby-1.9.3).
127
127
  </div>
@@ -321,7 +321,7 @@
321
321
  </div>
322
322
 
323
323
  <div id="footer">
324
- Generated on Thu Feb 28 08:44:08 2013 by
324
+ Generated on Sun Mar 24 10:59:44 2013 by
325
325
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
326
326
  0.8.5.2 (ruby-1.9.3).
327
327
  </div>
@@ -1576,7 +1576,7 @@
1576
1576
  </div>
1577
1577
 
1578
1578
  <div id="footer">
1579
- Generated on Thu Feb 28 08:44:08 2013 by
1579
+ Generated on Sun Mar 24 10:59:44 2013 by
1580
1580
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1581
1581
  0.8.5.2 (ruby-1.9.3).
1582
1582
  </div>
@@ -217,7 +217,7 @@ Pathname.new("/usr/bin/ruby").components
217
217
  </div>
218
218
 
219
219
  <div id="footer">
220
- Generated on Thu Feb 28 08:44:09 2013 by
220
+ Generated on Sun Mar 24 10:59:45 2013 by
221
221
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
222
222
  0.8.5.2 (ruby-1.9.3).
223
223
  </div>
@@ -2501,7 +2501,7 @@
2501
2501
  </div>
2502
2502
 
2503
2503
  <div id="footer">
2504
- Generated on Thu Feb 28 08:44:10 2013 by
2504
+ Generated on Sun Mar 24 10:59:45 2013 by
2505
2505
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2506
2506
  0.8.5.2 (ruby-1.9.3).
2507
2507
  </div>
@@ -464,7 +464,7 @@
464
464
  </div>
465
465
 
466
466
  <div id="footer">
467
- Generated on Thu Feb 28 08:44:09 2013 by
467
+ Generated on Sun Mar 24 10:59:44 2013 by
468
468
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
469
469
  0.8.5.2 (ruby-1.9.3).
470
470
  </div>
@@ -1674,7 +1674,7 @@
1674
1674
  </div>
1675
1675
 
1676
1676
  <div id="footer">
1677
- Generated on Thu Feb 28 08:44:09 2013 by
1677
+ Generated on Sun Mar 24 10:59:44 2013 by
1678
1678
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1679
1679
  0.8.5.2 (ruby-1.9.3).
1680
1680
  </div>
@@ -1023,7 +1023,7 @@ DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US &amp; Canad
1023
1023
  </div>
1024
1024
 
1025
1025
  <div id="footer">
1026
- Generated on Thu Feb 28 08:44:09 2013 by
1026
+ Generated on Sun Mar 24 10:59:45 2013 by
1027
1027
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1028
1028
  0.8.5.2 (ruby-1.9.3).
1029
1029
  </div>
@@ -134,7 +134,7 @@
134
134
 
135
135
  </div>
136
136
  </dt>
137
- <dd><pre class="code"><span class='int'>7</span></pre></dd>
137
+ <dd><pre class="code"><span class='int'>8</span></pre></dd>
138
138
 
139
139
  <dt id="PATCH-constant" class="">PATCH =
140
140
  <div class="docstring">
@@ -180,7 +180,7 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Thu Feb 28 08:44:09 2013 by
183
+ Generated on Sun Mar 24 10:59:44 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
185
  0.8.5.2 (ruby-1.9.3).
186
186
  </div>
data/doc/_index.html CHANGED
@@ -326,7 +326,7 @@
326
326
  </div>
327
327
 
328
328
  <div id="footer">
329
- Generated on Thu Feb 28 08:44:08 2013 by
329
+ Generated on Sun Mar 24 10:59:43 2013 by
330
330
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
331
331
  0.8.5.2 (ruby-1.9.3).
332
332
  </div>
data/doc/file.README.html CHANGED
@@ -104,7 +104,7 @@ See documentation for more informations.</p>
104
104
  </div></div>
105
105
 
106
106
  <div id="footer">
107
- Generated on Thu Feb 28 08:44:08 2013 by
107
+ Generated on Sun Mar 24 10:59:43 2013 by
108
108
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
109
  0.8.5.2 (ruby-1.9.3).
110
110
  </div>
data/doc/index.html CHANGED
@@ -104,7 +104,7 @@ See documentation for more informations.</p>
104
104
  </div></div>
105
105
 
106
106
  <div id="footer">
107
- Generated on Thu Feb 28 08:44:08 2013 by
107
+ Generated on Sun Mar 24 10:59:43 2013 by
108
108
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
109
  0.8.5.2 (ruby-1.9.3).
110
110
  </div>
data/doc/method_list.html CHANGED
@@ -199,6 +199,14 @@
199
199
 
200
200
 
201
201
  <li class="r2 ">
202
+ <span class='object_link'><a href="Lazier.html#find_class-class_method" title="Lazier.find_class (method)">find_class</a></span>
203
+
204
+ <small>Lazier</small>
205
+
206
+ </li>
207
+
208
+
209
+ <li class="r1 ">
202
210
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#find_timezone-instance_method" title="Lazier::DateTime::ClassMethods#find_timezone (method)">#find_timezone</a></span>
203
211
 
204
212
  <small>Lazier::DateTime::ClassMethods</small>
@@ -206,7 +214,7 @@
206
214
  </li>
207
215
 
208
216
 
209
- <li class="r1 ">
217
+ <li class="r2 ">
210
218
  <span class='object_link'><a href="Lazier/Object.html#format_boolean-instance_method" title="Lazier::Object#format_boolean (method)">#format_boolean</a></span>
211
219
 
212
220
  <small>Lazier::Object</small>
@@ -214,7 +222,7 @@
214
222
  </li>
215
223
 
216
224
 
217
- <li class="r2 ">
225
+ <li class="r1 ">
218
226
  <span class='object_link'><a href="Lazier/Settings.html#format_number-instance_method" title="Lazier::Settings#format_number (method)">#format_number</a></span>
219
227
 
220
228
  <small>Lazier::Settings</small>
@@ -222,7 +230,7 @@
222
230
  </li>
223
231
 
224
232
 
225
- <li class="r1 ">
233
+ <li class="r2 ">
226
234
  <span class='object_link'><a href="Lazier/Object.html#format_number-instance_method" title="Lazier::Object#format_number (method)">#format_number</a></span>
227
235
 
228
236
  <small>Lazier::Object</small>
@@ -230,7 +238,7 @@
230
238
  </li>
231
239
 
232
240
 
233
- <li class="r2 ">
241
+ <li class="r1 ">
234
242
  <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#format_offset-instance_method" title="Lazier::TimeZone::ClassMethods#format_offset (method)">#format_offset</a></span>
235
243
 
236
244
  <small>Lazier::TimeZone::ClassMethods</small>
@@ -238,7 +246,7 @@
238
246
  </li>
239
247
 
240
248
 
241
- <li class="r1 ">
249
+ <li class="r2 ">
242
250
  <span class='object_link'><a href="Lazier/Settings.html#i18n-instance_method" title="Lazier::Settings#i18n (method)">#i18n</a></span>
243
251
 
244
252
  <small>Lazier::Settings</small>
@@ -246,7 +254,7 @@
246
254
  </li>
247
255
 
248
256
 
249
- <li class="r2 ">
257
+ <li class="r1 ">
250
258
  <span class='object_link'><a href="Lazier/I18n.html#i18n-instance_method" title="Lazier::I18n#i18n (method)">#i18n</a></span>
251
259
 
252
260
  <small>Lazier::I18n</small>
@@ -254,7 +262,7 @@
254
262
  </li>
255
263
 
256
264
 
257
- <li class="r1 ">
265
+ <li class="r2 ">
258
266
  <span class='object_link'><a href="Lazier/I18n.html#i18n%3D-instance_method" title="Lazier::I18n#i18n= (method)">#i18n=</a></span>
259
267
 
260
268
  <small>Lazier::I18n</small>
@@ -262,7 +270,7 @@
262
270
  </li>
263
271
 
264
272
 
265
- <li class="r2 ">
273
+ <li class="r1 ">
266
274
  <span class='object_link'><a href="Lazier/I18n.html#i18n_locale-instance_method" title="Lazier::I18n#i18n_locale (method)">#i18n_locale</a></span>
267
275
 
268
276
  <small>Lazier::I18n</small>
@@ -270,7 +278,7 @@
270
278
  </li>
271
279
 
272
280
 
273
- <li class="r1 ">
281
+ <li class="r2 ">
274
282
  <span class='object_link'><a href="Lazier/I18n.html#i18n_locales_path-instance_method" title="Lazier::I18n#i18n_locales_path (method)">#i18n_locales_path</a></span>
275
283
 
276
284
  <small>Lazier::I18n</small>
@@ -278,7 +286,7 @@
278
286
  </li>
279
287
 
280
288
 
281
- <li class="r2 ">
289
+ <li class="r1 ">
282
290
  <span class='object_link'><a href="Lazier/I18n.html#i18n_root-instance_method" title="Lazier::I18n#i18n_root (method)">#i18n_root</a></span>
283
291
 
284
292
  <small>Lazier::I18n</small>
@@ -286,7 +294,7 @@
286
294
  </li>
287
295
 
288
296
 
289
- <li class="r1 ">
297
+ <li class="r2 ">
290
298
  <span class='object_link'><a href="Lazier/I18n.html#i18n_setup-instance_method" title="Lazier::I18n#i18n_setup (method)">#i18n_setup</a></span>
291
299
 
292
300
  <small>Lazier::I18n</small>
@@ -294,7 +302,7 @@
294
302
  </li>
295
303
 
296
304
 
297
- <li class="r2 ">
305
+ <li class="r1 ">
298
306
  <span class='object_link'><a href="Lazier/DateTime.html#in_months-instance_method" title="Lazier::DateTime#in_months (method)">#in_months</a></span>
299
307
 
300
308
  <small>Lazier::DateTime</small>
@@ -302,6 +310,14 @@
302
310
  </li>
303
311
 
304
312
 
313
+ <li class="r2 ">
314
+ <span class='object_link'><a href="Lazier/Localizer.html#initialize-instance_method" title="Lazier::Localizer#initialize (method)">#initialize</a></span>
315
+
316
+ <small>Lazier::Localizer</small>
317
+
318
+ </li>
319
+
320
+
305
321
  <li class="r1 ">
306
322
  <span class='object_link'><a href="Lazier/Settings.html#initialize-instance_method" title="Lazier::Settings#initialize (method)">#initialize</a></span>
307
323
 
@@ -319,14 +335,6 @@
319
335
 
320
336
 
321
337
  <li class="r1 ">
322
- <span class='object_link'><a href="Lazier/Localizer.html#initialize-instance_method" title="Lazier::Localizer#initialize (method)">#initialize</a></span>
323
-
324
- <small>Lazier::Localizer</small>
325
-
326
- </li>
327
-
328
-
329
- <li class="r2 ">
330
338
  <span class='object_link'><a href="Lazier/Settings.html#instance-class_method" title="Lazier::Settings.instance (method)">instance</a></span>
331
339
 
332
340
  <small>Lazier::Settings</small>
@@ -334,7 +342,7 @@
334
342
  </li>
335
343
 
336
344
 
337
- <li class="r1 ">
345
+ <li class="r2 ">
338
346
  <span class='object_link'><a href="Lazier/Object.html#is_boolean%3F-instance_method" title="Lazier::Object#is_boolean? (method)">#is_boolean?</a></span>
339
347
 
340
348
  <small>Lazier::Object</small>
@@ -342,7 +350,7 @@
342
350
  </li>
343
351
 
344
352
 
345
- <li class="r2 ">
353
+ <li class="r1 ">
346
354
  <span class='object_link'><a href="Lazier/Object.html#is_float%3F-instance_method" title="Lazier::Object#is_float? (method)">#is_float?</a></span>
347
355
 
348
356
  <small>Lazier::Object</small>
@@ -350,7 +358,7 @@
350
358
  </li>
351
359
 
352
360
 
353
- <li class="r1 ">
361
+ <li class="r2 ">
354
362
  <span class='object_link'><a href="Lazier/Object.html#is_integer%3F-instance_method" title="Lazier::Object#is_integer? (method)">#is_integer?</a></span>
355
363
 
356
364
  <small>Lazier::Object</small>
@@ -358,7 +366,7 @@
358
366
  </li>
359
367
 
360
368
 
361
- <li class="r2 ">
369
+ <li class="r1 ">
362
370
  <span class='object_link'><a href="Lazier/Object.html#is_number%3F-instance_method" title="Lazier::Object#is_number? (method)">#is_number?</a></span>
363
371
 
364
372
  <small>Lazier::Object</small>
@@ -366,7 +374,7 @@
366
374
  </li>
367
375
 
368
376
 
369
- <li class="r1 ">
377
+ <li class="r2 ">
370
378
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#is_valid%3F-instance_method" title="Lazier::DateTime::ClassMethods#is_valid? (method)">#is_valid?</a></span>
371
379
 
372
380
  <small>Lazier::DateTime::ClassMethods</small>
@@ -374,7 +382,7 @@
374
382
  </li>
375
383
 
376
384
 
377
- <li class="r2 ">
385
+ <li class="r1 ">
378
386
  <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#list_all-instance_method" title="Lazier::TimeZone::ClassMethods#list_all (method)">#list_all</a></span>
379
387
 
380
388
  <small>Lazier::TimeZone::ClassMethods</small>
@@ -382,7 +390,7 @@
382
390
  </li>
383
391
 
384
392
 
385
- <li class="r1 ">
393
+ <li class="r2 ">
386
394
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#list_timezones-instance_method" title="Lazier::DateTime::ClassMethods#list_timezones (method)">#list_timezones</a></span>
387
395
 
388
396
  <small>Lazier::DateTime::ClassMethods</small>
@@ -390,7 +398,7 @@
390
398
  </li>
391
399
 
392
400
 
393
- <li class="r2 ">
401
+ <li class="r1 ">
394
402
  <span class='object_link'><a href="Lazier.html#load%21-class_method" title="Lazier.load! (method)">load!</a></span>
395
403
 
396
404
  <small>Lazier</small>
@@ -398,7 +406,7 @@
398
406
  </li>
399
407
 
400
408
 
401
- <li class="r1 ">
409
+ <li class="r2 ">
402
410
  <span class='object_link'><a href="Lazier.html#load_boolean-class_method" title="Lazier.load_boolean (method)">load_boolean</a></span>
403
411
 
404
412
  <small>Lazier</small>
@@ -406,7 +414,7 @@
406
414
  </li>
407
415
 
408
416
 
409
- <li class="r2 ">
417
+ <li class="r1 ">
410
418
  <span class='object_link'><a href="Lazier.html#load_datetime-class_method" title="Lazier.load_datetime (method)">load_datetime</a></span>
411
419
 
412
420
  <small>Lazier</small>
@@ -414,7 +422,7 @@
414
422
  </li>
415
423
 
416
424
 
417
- <li class="r1 ">
425
+ <li class="r2 ">
418
426
  <span class='object_link'><a href="Lazier.html#load_hash-class_method" title="Lazier.load_hash (method)">load_hash</a></span>
419
427
 
420
428
  <small>Lazier</small>
@@ -422,7 +430,7 @@
422
430
  </li>
423
431
 
424
432
 
425
- <li class="r2 ">
433
+ <li class="r1 ">
426
434
  <span class='object_link'><a href="Lazier.html#load_math-class_method" title="Lazier.load_math (method)">load_math</a></span>
427
435
 
428
436
  <small>Lazier</small>
@@ -430,7 +438,7 @@
430
438
  </li>
431
439
 
432
440
 
433
- <li class="r1 ">
441
+ <li class="r2 ">
434
442
  <span class='object_link'><a href="Lazier.html#load_object-class_method" title="Lazier.load_object (method)">load_object</a></span>
435
443
 
436
444
  <small>Lazier</small>
@@ -438,7 +446,7 @@
438
446
  </li>
439
447
 
440
448
 
441
- <li class="r2 ">
449
+ <li class="r1 ">
442
450
  <span class='object_link'><a href="Lazier.html#load_pathname-class_method" title="Lazier.load_pathname (method)">load_pathname</a></span>
443
451
 
444
452
  <small>Lazier</small>
@@ -446,7 +454,7 @@
446
454
  </li>
447
455
 
448
456
 
449
- <li class="r1 ">
457
+ <li class="r2 ">
450
458
  <span class='object_link'><a href="Lazier.html#load_string-class_method" title="Lazier.load_string (method)">load_string</a></span>
451
459
 
452
460
  <small>Lazier</small>
@@ -454,7 +462,7 @@
454
462
  </li>
455
463
 
456
464
 
457
- <li class="r2 ">
465
+ <li class="r1 ">
458
466
  <span class='object_link'><a href="Lazier/DateTime.html#local_lstrftime-instance_method" title="Lazier::DateTime#local_lstrftime (method)">#local_lstrftime</a></span>
459
467
 
460
468
  <small>Lazier::DateTime</small>
@@ -462,7 +470,7 @@
462
470
  </li>
463
471
 
464
472
 
465
- <li class="r1 ">
473
+ <li class="r2 ">
466
474
  <span class='object_link'><a href="Lazier/DateTime.html#local_strftime-instance_method" title="Lazier::DateTime#local_strftime (method)">#local_strftime</a></span>
467
475
 
468
476
  <small>Lazier::DateTime</small>
@@ -470,7 +478,7 @@
470
478
  </li>
471
479
 
472
480
 
473
- <li class="r2 ">
481
+ <li class="r1 ">
474
482
  <span class='object_link'><a href="Lazier/Localizer.html#localize-class_method" title="Lazier::Localizer.localize (method)">localize</a></span>
475
483
 
476
484
  <small>Lazier::Localizer</small>
@@ -478,7 +486,7 @@
478
486
  </li>
479
487
 
480
488
 
481
- <li class="r1 ">
489
+ <li class="r2 ">
482
490
  <span class='object_link'><a href="Lazier/Localizer.html#localize_on_locale-class_method" title="Lazier::Localizer.localize_on_locale (method)">localize_on_locale</a></span>
483
491
 
484
492
  <small>Lazier::Localizer</small>
@@ -486,7 +494,7 @@
486
494
  </li>
487
495
 
488
496
 
489
- <li class="r2 ">
497
+ <li class="r1 ">
490
498
  <span class='object_link'><a href="Lazier/DateTime.html#lstrftime-instance_method" title="Lazier::DateTime#lstrftime (method)">#lstrftime</a></span>
491
499
 
492
500
  <small>Lazier::DateTime</small>
@@ -494,7 +502,7 @@
494
502
  </li>
495
503
 
496
504
 
497
- <li class="r1 ">
505
+ <li class="r2 ">
498
506
  <span class='object_link'><a href="Lazier/Math/ClassMethods.html#max-instance_method" title="Lazier::Math::ClassMethods#max (method)">#max</a></span>
499
507
 
500
508
  <small>Lazier::Math::ClassMethods</small>
@@ -502,7 +510,7 @@
502
510
  </li>
503
511
 
504
512
 
505
- <li class="r2 ">
513
+ <li class="r1 ">
506
514
  <span class='object_link'><a href="Lazier/Hash.html#method_missing-instance_method" title="Lazier::Hash#method_missing (method)">#method_missing</a></span>
507
515
 
508
516
  <small>Lazier::Hash</small>
@@ -510,7 +518,7 @@
510
518
  </li>
511
519
 
512
520
 
513
- <li class="r1 ">
521
+ <li class="r2 ">
514
522
  <span class='object_link'><a href="Lazier/Math/ClassMethods.html#min-instance_method" title="Lazier::Math::ClassMethods#min (method)">#min</a></span>
515
523
 
516
524
  <small>Lazier::Math::ClassMethods</small>
@@ -518,7 +526,7 @@
518
526
  </li>
519
527
 
520
528
 
521
- <li class="r2 ">
529
+ <li class="r1 ">
522
530
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#months-instance_method" title="Lazier::DateTime::ClassMethods#months (method)">#months</a></span>
523
531
 
524
532
  <small>Lazier::DateTime::ClassMethods</small>
@@ -526,7 +534,7 @@
526
534
  </li>
527
535
 
528
536
 
529
- <li class="r1 ">
537
+ <li class="r2 ">
530
538
  <span class='object_link'><a href="Lazier/Object.html#normalize_number-instance_method" title="Lazier::Object#normalize_number (method)">#normalize_number</a></span>
531
539
 
532
540
  <small>Lazier::Object</small>
@@ -534,7 +542,7 @@
534
542
  </li>
535
543
 
536
544
 
537
- <li class="r2 ">
545
+ <li class="r1 ">
538
546
  <span class='object_link'><a href="Lazier/TimeZone.html#offset-instance_method" title="Lazier::TimeZone#offset (method)">#offset</a></span>
539
547
 
540
548
  <small>Lazier::TimeZone</small>
@@ -542,7 +550,7 @@
542
550
  </li>
543
551
 
544
552
 
545
- <li class="r1 ">
553
+ <li class="r2 ">
546
554
  <span class='object_link'><a href="Lazier/DateTime.html#padded_month-instance_method" title="Lazier::DateTime#padded_month (method)">#padded_month</a></span>
547
555
 
548
556
  <small>Lazier::DateTime</small>
@@ -550,7 +558,7 @@
550
558
  </li>
551
559
 
552
560
 
553
- <li class="r2 ">
561
+ <li class="r1 ">
554
562
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#parameterize_zone-instance_method" title="Lazier::DateTime::ClassMethods#parameterize_zone (method)">#parameterize_zone</a></span>
555
563
 
556
564
  <small>Lazier::DateTime::ClassMethods</small>
@@ -558,7 +566,7 @@
558
566
  </li>
559
567
 
560
568
 
561
- <li class="r1 ">
569
+ <li class="r2 ">
562
570
  <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#parameterize_zone-instance_method" title="Lazier::TimeZone::ClassMethods#parameterize_zone (method)">#parameterize_zone</a></span>
563
571
 
564
572
  <small>Lazier::TimeZone::ClassMethods</small>
@@ -566,23 +574,23 @@
566
574
  </li>
567
575
 
568
576
 
569
- <li class="r2 ">
570
- <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#rationalize_offset-instance_method" title="Lazier::DateTime::ClassMethods#rationalize_offset (method)">#rationalize_offset</a></span>
577
+ <li class="r1 ">
578
+ <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#rationalize_offset-instance_method" title="Lazier::TimeZone::ClassMethods#rationalize_offset (method)">#rationalize_offset</a></span>
571
579
 
572
- <small>Lazier::DateTime::ClassMethods</small>
580
+ <small>Lazier::TimeZone::ClassMethods</small>
573
581
 
574
582
  </li>
575
583
 
576
584
 
577
- <li class="r1 ">
578
- <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#rationalize_offset-instance_method" title="Lazier::TimeZone::ClassMethods#rationalize_offset (method)">#rationalize_offset</a></span>
585
+ <li class="r2 ">
586
+ <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#rationalize_offset-instance_method" title="Lazier::DateTime::ClassMethods#rationalize_offset (method)">#rationalize_offset</a></span>
579
587
 
580
- <small>Lazier::TimeZone::ClassMethods</small>
588
+ <small>Lazier::DateTime::ClassMethods</small>
581
589
 
582
590
  </li>
583
591
 
584
592
 
585
- <li class="r2 ">
593
+ <li class="r1 ">
586
594
  <span class='object_link'><a href="Lazier/String.html#remove_accents-instance_method" title="Lazier::String#remove_accents (method)">#remove_accents</a></span>
587
595
 
588
596
  <small>Lazier::String</small>
@@ -590,7 +598,7 @@
590
598
  </li>
591
599
 
592
600
 
593
- <li class="r1 ">
601
+ <li class="r2 ">
594
602
  <span class='object_link'><a href="Lazier/String.html#replace_ampersands-instance_method" title="Lazier::String#replace_ampersands (method)">#replace_ampersands</a></span>
595
603
 
596
604
  <small>Lazier::String</small>
@@ -598,7 +606,7 @@
598
606
  </li>
599
607
 
600
608
 
601
- <li class="r2 ">
609
+ <li class="r1 ">
602
610
  <span class='object_link'><a href="Lazier/Hash.html#respond_to%3F-instance_method" title="Lazier::Hash#respond_to? (method)">#respond_to?</a></span>
603
611
 
604
612
  <small>Lazier::Hash</small>
@@ -606,7 +614,7 @@
606
614
  </li>
607
615
 
608
616
 
609
- <li class="r1 ">
617
+ <li class="r2 ">
610
618
  <span class='object_link'><a href="Lazier/Object.html#round_to_precision-instance_method" title="Lazier::Object#round_to_precision (method)">#round_to_precision</a></span>
611
619
 
612
620
  <small>Lazier::Object</small>
@@ -614,7 +622,7 @@
614
622
  </li>
615
623
 
616
624
 
617
- <li class="r2 ">
625
+ <li class="r1 ">
618
626
  <span class='object_link'><a href="Lazier.html#settings-class_method" title="Lazier.settings (method)">settings</a></span>
619
627
 
620
628
  <small>Lazier</small>
@@ -622,7 +630,7 @@
622
630
  </li>
623
631
 
624
632
 
625
- <li class="r1 ">
633
+ <li class="r2 ">
626
634
  <span class='object_link'><a href="Lazier/Settings.html#setup-instance_method" title="Lazier::Settings#setup (method)">#setup</a></span>
627
635
 
628
636
  <small>Lazier::Settings</small>
@@ -630,7 +638,7 @@
630
638
  </li>
631
639
 
632
640
 
633
- <li class="r2 ">
641
+ <li class="r1 ">
634
642
  <span class='object_link'><a href="Lazier/Settings.html#setup_boolean_names-instance_method" title="Lazier::Settings#setup_boolean_names (method)">#setup_boolean_names</a></span>
635
643
 
636
644
  <small>Lazier::Settings</small>
@@ -638,7 +646,7 @@
638
646
  </li>
639
647
 
640
648
 
641
- <li class="r1 ">
649
+ <li class="r2 ">
642
650
  <span class='object_link'><a href="Lazier/Settings.html#setup_date_formats-instance_method" title="Lazier::Settings#setup_date_formats (method)">#setup_date_formats</a></span>
643
651
 
644
652
  <small>Lazier::Settings</small>
@@ -646,7 +654,7 @@
646
654
  </li>
647
655
 
648
656
 
649
- <li class="r2 ">
657
+ <li class="r1 ">
650
658
  <span class='object_link'><a href="Lazier/Settings.html#setup_date_names-instance_method" title="Lazier::Settings#setup_date_names (method)">#setup_date_names</a></span>
651
659
 
652
660
  <small>Lazier::Settings</small>
@@ -654,7 +662,7 @@
654
662
  </li>
655
663
 
656
664
 
657
- <li class="r1 ">
665
+ <li class="r2 ">
658
666
  <span class='object_link'><a href="Lazier/Settings.html#setup_format_number-instance_method" title="Lazier::Settings#setup_format_number (method)">#setup_format_number</a></span>
659
667
 
660
668
  <small>Lazier::Settings</small>
@@ -662,7 +670,7 @@
662
670
  </li>
663
671
 
664
672
 
665
- <li class="r2 ">
673
+ <li class="r1 ">
666
674
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#timezones-instance_method" title="Lazier::DateTime::ClassMethods#timezones (method)">#timezones</a></span>
667
675
 
668
676
  <small>Lazier::DateTime::ClassMethods</small>
@@ -670,7 +678,7 @@
670
678
  </li>
671
679
 
672
680
 
673
- <li class="r1 ">
681
+ <li class="r2 ">
674
682
  <span class='object_link'><a href="Lazier/Object.html#to_boolean-instance_method" title="Lazier::Object#to_boolean (method)">#to_boolean</a></span>
675
683
 
676
684
  <small>Lazier::Object</small>
@@ -678,7 +686,7 @@
678
686
  </li>
679
687
 
680
688
 
681
- <li class="r2 ">
689
+ <li class="r1 ">
682
690
  <span class='object_link'><a href="Lazier/Object.html#to_float-instance_method" title="Lazier::Object#to_float (method)">#to_float</a></span>
683
691
 
684
692
  <small>Lazier::Object</small>
@@ -686,7 +694,7 @@
686
694
  </li>
687
695
 
688
696
 
689
- <li class="r1 ">
697
+ <li class="r2 ">
690
698
  <span class='object_link'><a href="Lazier/Boolean.html#to_i-instance_method" title="Lazier::Boolean#to_i (method)">#to_i</a></span>
691
699
 
692
700
  <small>Lazier::Boolean</small>
@@ -694,7 +702,7 @@
694
702
  </li>
695
703
 
696
704
 
697
- <li class="r2 ">
705
+ <li class="r1 ">
698
706
  <span class='object_link'><a href="Lazier/Object.html#to_integer-instance_method" title="Lazier::Object#to_integer (method)">#to_integer</a></span>
699
707
 
700
708
  <small>Lazier::Object</small>
@@ -702,7 +710,7 @@
702
710
  </li>
703
711
 
704
712
 
705
- <li class="r1 ">
713
+ <li class="r2 ">
706
714
  <span class='object_link'><a href="Lazier/TimeZone.html#to_str-instance_method" title="Lazier::TimeZone#to_str (method)">#to_str</a></span>
707
715
 
708
716
  <small>Lazier::TimeZone</small>
@@ -710,7 +718,7 @@
710
718
  </li>
711
719
 
712
720
 
713
- <li class="r2 ">
721
+ <li class="r1 ">
714
722
  <span class='object_link'><a href="Lazier/TimeZone.html#to_str_parameterized-instance_method" title="Lazier::TimeZone#to_str_parameterized (method)">#to_str_parameterized</a></span>
715
723
 
716
724
  <small>Lazier::TimeZone</small>
@@ -718,7 +726,7 @@
718
726
  </li>
719
727
 
720
728
 
721
- <li class="r1 ">
729
+ <li class="r2 ">
722
730
  <span class='object_link'><a href="Lazier/TimeZone.html#to_str_with_dst-instance_method" title="Lazier::TimeZone#to_str_with_dst (method)">#to_str_with_dst</a></span>
723
731
 
724
732
  <small>Lazier::TimeZone</small>
@@ -726,7 +734,7 @@
726
734
  </li>
727
735
 
728
736
 
729
- <li class="r2 ">
737
+ <li class="r1 ">
730
738
  <span class='object_link'><a href="Lazier/TimeZone.html#to_str_with_dst_parameterized-instance_method" title="Lazier::TimeZone#to_str_with_dst_parameterized (method)">#to_str_with_dst_parameterized</a></span>
731
739
 
732
740
  <small>Lazier::TimeZone</small>
@@ -734,7 +742,7 @@
734
742
  </li>
735
743
 
736
744
 
737
- <li class="r1 ">
745
+ <li class="r2 ">
738
746
  <span class='object_link'><a href="Lazier/TimeZone/ClassMethods.html#unparameterize_zone-instance_method" title="Lazier::TimeZone::ClassMethods#unparameterize_zone (method)">#unparameterize_zone</a></span>
739
747
 
740
748
  <small>Lazier::TimeZone::ClassMethods</small>
@@ -742,7 +750,7 @@
742
750
  </li>
743
751
 
744
752
 
745
- <li class="r2 ">
753
+ <li class="r1 ">
746
754
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#unparameterize_zone-instance_method" title="Lazier::DateTime::ClassMethods#unparameterize_zone (method)">#unparameterize_zone</a></span>
747
755
 
748
756
  <small>Lazier::DateTime::ClassMethods</small>
@@ -750,7 +758,7 @@
750
758
  </li>
751
759
 
752
760
 
753
- <li class="r1 ">
761
+ <li class="r2 ">
754
762
  <span class='object_link'><a href="Lazier/String.html#untitleize-instance_method" title="Lazier::String#untitleize (method)">#untitleize</a></span>
755
763
 
756
764
  <small>Lazier::String</small>
@@ -758,7 +766,7 @@
758
766
  </li>
759
767
 
760
768
 
761
- <li class="r2 ">
769
+ <li class="r1 ">
762
770
  <span class='object_link'><a href="Lazier/TimeZone.html#uses_dst%3F-instance_method" title="Lazier::TimeZone#uses_dst? (method)">#uses_dst?</a></span>
763
771
 
764
772
  <small>Lazier::TimeZone</small>
@@ -766,7 +774,7 @@
766
774
  </li>
767
775
 
768
776
 
769
- <li class="r1 ">
777
+ <li class="r2 ">
770
778
  <span class='object_link'><a href="Lazier/DateTime.html#utc_time-instance_method" title="Lazier::DateTime#utc_time (method)">#utc_time</a></span>
771
779
 
772
780
  <small>Lazier::DateTime</small>
@@ -774,23 +782,23 @@
774
782
  </li>
775
783
 
776
784
 
777
- <li class="r2 ">
778
- <span class='object_link'><a href="Lazier/String.html#value-instance_method" title="Lazier::String#value (method)">#value</a></span>
785
+ <li class="r1 ">
786
+ <span class='object_link'><a href="Lazier/Boolean.html#value-instance_method" title="Lazier::Boolean#value (method)">#value</a></span>
779
787
 
780
- <small>Lazier::String</small>
788
+ <small>Lazier::Boolean</small>
781
789
 
782
790
  </li>
783
791
 
784
792
 
785
- <li class="r1 ">
786
- <span class='object_link'><a href="Lazier/Boolean.html#value-instance_method" title="Lazier::Boolean#value (method)">#value</a></span>
793
+ <li class="r2 ">
794
+ <span class='object_link'><a href="Lazier/String.html#value-instance_method" title="Lazier::String#value (method)">#value</a></span>
787
795
 
788
- <small>Lazier::Boolean</small>
796
+ <small>Lazier::String</small>
789
797
 
790
798
  </li>
791
799
 
792
800
 
793
- <li class="r2 ">
801
+ <li class="r1 ">
794
802
  <span class='object_link'><a href="Lazier/DateTime/ClassMethods.html#years-instance_method" title="Lazier::DateTime::ClassMethods#years (method)">#years</a></span>
795
803
 
796
804
  <small>Lazier::DateTime::ClassMethods</small>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Thu Feb 28 08:44:08 2013 by
106
+ Generated on Sun Mar 24 10:59:43 2013 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.5.2 (ruby-1.9.3).
109
109
  </div>
data/lazier.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
25
25
  gem.required_ruby_version = ">= 1.9.3"
26
26
 
27
27
  gem.add_dependency("json", "~> 1.7.7")
28
- gem.add_dependency("actionpack", ">= 3.2.12") # We don't use ~> to enable use with 4.0
28
+ gem.add_dependency("actionpack", ">= 3.2.13") # We don't use ~> to enable use with 4.0
29
29
  gem.add_dependency("tzinfo", "~> 0.3.35")
30
30
  gem.add_dependency("r18n-desktop", "~> 1.1.4")
31
31
  end
data/lib/lazier.rb CHANGED
@@ -118,4 +118,37 @@ module Lazier
118
118
  include ::Lazier::Pathname
119
119
  end
120
120
  end
121
+
122
+ # Finds a class to instantiate.
123
+ #
124
+ # @param cls [Symbol|String|Object] If a `String` or a `Symbol` or a `Class`, then it will be the class to instantiate. Otherwise the class of the object will returned.
125
+ # @param scope [String] An additional scope to find the class. `%CLASS%` will be substituted with the class name.
126
+ # @param only_in_scope [Boolean] If only try to instantiate the class in the scope.
127
+ # @return [Class] The found class.
128
+ def self.find_class(cls, scope = "::%CLASS%", only_in_scope = false)
129
+ if cls.is_a?(String) || cls.is_a?(Symbol) then
130
+ rv = nil
131
+ cls = cls.to_s.camelize
132
+
133
+ if only_in_scope then
134
+ cls.gsub!(/^::/, "") # Mark only search only inside scope
135
+ else
136
+ rv = search_class(cls) # Search outside scope
137
+ end
138
+
139
+ rv = search_class(scope.to_s.gsub("%CLASS%", cls)) if !rv && cls !~ /^::/ && scope.present? # Search inside scope
140
+ rv || raise(NameError.new("", cls))
141
+ else
142
+ cls.is_a?(Class) ? cls : cls.class
143
+ end
144
+ end
145
+
146
+ private
147
+ # Tries to search a class.
148
+ #
149
+ # @param cls [String] The class to search.
150
+ # @return [Class] The instantiated class or `nil`, if the class was not found.
151
+ def self.search_class(cls)
152
+ cls.constantize rescue nil
153
+ end
121
154
  end
@@ -13,7 +13,7 @@ module Lazier
13
13
  MAJOR = 2
14
14
 
15
15
  # The minor version.
16
- MINOR = 7
16
+ MINOR = 8
17
17
 
18
18
  # The patch version.
19
19
  PATCH = 0
data/spec/lazier_spec.rb CHANGED
@@ -43,4 +43,37 @@ describe Lazier do
43
43
  end
44
44
  end
45
45
  end
46
+
47
+ describe ".find_class" do
48
+ module LazierTest
49
+ class TestClass
50
+
51
+ end
52
+ end
53
+
54
+ it "should return a valid class" do
55
+ expect(::Lazier.find_class("String")).to eq(String)
56
+ expect(::Lazier.find_class("TestClass", "::LazierTest::%CLASS%")).to eq(::LazierTest::TestClass)
57
+ end
58
+
59
+ it "should raise an exception if the class is not found" do
60
+ expect { ::Lazier.find_class(:invalid) }.to raise_error(::NameError)
61
+ end
62
+
63
+ it "should not expand engine scope if the class starts with ::" do
64
+ expect { ::Lazier.find_class("::TestClass", "::LazierTest::%CLASS%") }.to raise_error(::NameError)
65
+ end
66
+
67
+ it "should only use scope if requested to" do
68
+ expect { ::Lazier.find_class("::Fixnum", "::LazierTest::%CLASS%", true) }.to raise_error(::NameError)
69
+ end
70
+
71
+ it "should return anything but string or symbol as their class" do
72
+ expect(::Lazier.find_class(nil)).to eq(NilClass)
73
+ expect(::Lazier.find_class(1)).to eq(Fixnum)
74
+ expect(::Lazier.find_class(["A"])).to eq(Array)
75
+ expect(::Lazier.find_class({a: "b"})).to eq(Hash)
76
+ expect(::Lazier.find_class(Hash)).to eq(Hash)
77
+ end
78
+ end
46
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-28 00:00:00.000000000 Z
12
+ date: 2013-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 3.2.12
37
+ version: 3.2.13
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 3.2.12
45
+ version: 3.2.13
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: tzinfo
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  segments:
173
173
  - 0
174
- hash: 1543346769697772444
174
+ hash: 4017477931142204248
175
175
  requirements: []
176
176
  rubyforge_project: lazier
177
177
  rubygems_version: 1.8.25