pueri 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,600 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Pueri::Age
8
+
9
+ &mdash; Documentation by YARD 0.9.20
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Pueri::Age";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Pueri.html" title="Pueri (module)">Pueri</a></span></span>
41
+ &raquo;
42
+ <span class="title">Age</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Pueri::Age
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Pueri::Age</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/pueri/age.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Parses a given date string into and Array of age. The array contains the
106
+ years, months and days of life of the one who was/would be born on the
107
+ given day.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
120
+ <ul class="summary">
121
+
122
+ <li class="public ">
123
+ <span class="summary_signature">
124
+
125
+ <a href="#age-instance_method" title="#age (instance method)">#<strong>age</strong> &#x21d2; Object </a>
126
+
127
+
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+ <span class="note title readonly">readonly</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'>
145
+ <p>Returns the value of attribute age.</p>
146
+ </div></span>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#days_month-instance_method" title="#days_month (instance method)">#<strong>days_month</strong> &#x21d2; Object </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+ <span class="note title readonly">readonly</span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>Returns the value of attribute days_month.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ </ul>
181
+
182
+
183
+
184
+
185
+
186
+ <h2>
187
+ Instance Method Summary
188
+ <small><a href="#" class="summary_toggle">collapse</a></small>
189
+ </h2>
190
+
191
+ <ul class="summary">
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(date) &#x21d2; Age </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+ <span class="note title constructor">constructor</span>
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>Creates an Age instance.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#to_f-instance_method" title="#to_f (instance method)">#<strong>to_f</strong> &#x21d2; Float </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+ <span class="summary_desc"><div class='inline'>
237
+ <p>Retrieves the age in days.</p>
238
+ </div></span>
239
+
240
+ </li>
241
+
242
+
243
+ <li class="public ">
244
+ <span class="summary_signature">
245
+
246
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong>(short = false) &#x21d2; String </a>
247
+
248
+
249
+
250
+ </span>
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+ <span class="summary_desc"><div class='inline'>
261
+ <p>Retrieves the age on a readable format.</p>
262
+ </div></span>
263
+
264
+ </li>
265
+
266
+
267
+ </ul>
268
+
269
+
270
+ <div id="constructor_details" class="method_details_list">
271
+ <h2>Constructor Details</h2>
272
+
273
+ <div class="method_details first">
274
+ <h3 class="signature first" id="initialize-instance_method">
275
+
276
+ #<strong>initialize</strong>(date) &#x21d2; <tt><span class='object_link'><a href="" title="Pueri::Age (class)">Age</a></span></tt>
277
+
278
+
279
+
280
+
281
+
282
+ </h3><div class="docstring">
283
+ <div class="discussion">
284
+
285
+ <p>Creates an Age instance.</p>
286
+
287
+
288
+ </div>
289
+ </div>
290
+ <div class="tags">
291
+ <p class="tag_title">Parameters:</p>
292
+ <ul class="param">
293
+
294
+ <li>
295
+
296
+ <span class='name'>date</span>
297
+
298
+
299
+ <span class='type'>(<tt>String</tt>)</span>
300
+
301
+
302
+
303
+ &mdash;
304
+ <div class='inline'>
305
+ <p>A date current or on the past - NOT on the future.</p>
306
+ </div>
307
+
308
+ </li>
309
+
310
+ </ul>
311
+
312
+
313
+ </div><table class="source_code">
314
+ <tr>
315
+ <td>
316
+ <pre class="lines">
317
+
318
+
319
+ 13
320
+ 14
321
+ 15
322
+ 16</pre>
323
+ </td>
324
+ <td>
325
+ <pre class="code"><span class="info file"># File 'lib/pueri/age.rb', line 13</span>
326
+
327
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
328
+ <span class='ivar'>@days_month</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>28</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='int'>31</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='int'>31</span><span class='rbracket'>]</span>
329
+ <span class='ivar'>@age</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_age'>parse_age</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
330
+ <span class='kw'>end</span></pre>
331
+ </td>
332
+ </tr>
333
+ </table>
334
+ </div>
335
+
336
+ </div>
337
+
338
+ <div id="instance_attr_details" class="attr_details">
339
+ <h2>Instance Attribute Details</h2>
340
+
341
+
342
+ <span id=""></span>
343
+ <div class="method_details first">
344
+ <h3 class="signature first" id="age-instance_method">
345
+
346
+ #<strong>age</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
347
+
348
+
349
+
350
+
351
+
352
+ </h3><div class="docstring">
353
+ <div class="discussion">
354
+
355
+ <p>Returns the value of attribute age</p>
356
+
357
+
358
+ </div>
359
+ </div>
360
+ <div class="tags">
361
+
362
+
363
+ </div><table class="source_code">
364
+ <tr>
365
+ <td>
366
+ <pre class="lines">
367
+
368
+
369
+ 8
370
+ 9
371
+ 10</pre>
372
+ </td>
373
+ <td>
374
+ <pre class="code"><span class="info file"># File 'lib/pueri/age.rb', line 8</span>
375
+
376
+ <span class='kw'>def</span> <span class='id identifier rubyid_age'>age</span>
377
+ <span class='ivar'>@age</span>
378
+ <span class='kw'>end</span></pre>
379
+ </td>
380
+ </tr>
381
+ </table>
382
+ </div>
383
+
384
+
385
+ <span id=""></span>
386
+ <div class="method_details ">
387
+ <h3 class="signature " id="days_month-instance_method">
388
+
389
+ #<strong>days_month</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
390
+
391
+
392
+
393
+
394
+
395
+ </h3><div class="docstring">
396
+ <div class="discussion">
397
+
398
+ <p>Returns the value of attribute days_month</p>
399
+
400
+
401
+ </div>
402
+ </div>
403
+ <div class="tags">
404
+
405
+
406
+ </div><table class="source_code">
407
+ <tr>
408
+ <td>
409
+ <pre class="lines">
410
+
411
+
412
+ 8
413
+ 9
414
+ 10</pre>
415
+ </td>
416
+ <td>
417
+ <pre class="code"><span class="info file"># File 'lib/pueri/age.rb', line 8</span>
418
+
419
+ <span class='kw'>def</span> <span class='id identifier rubyid_days_month'>days_month</span>
420
+ <span class='ivar'>@days_month</span>
421
+ <span class='kw'>end</span></pre>
422
+ </td>
423
+ </tr>
424
+ </table>
425
+ </div>
426
+
427
+ </div>
428
+
429
+
430
+ <div id="instance_method_details" class="method_details_list">
431
+ <h2>Instance Method Details</h2>
432
+
433
+
434
+ <div class="method_details first">
435
+ <h3 class="signature first" id="to_f-instance_method">
436
+
437
+ #<strong>to_f</strong> &#x21d2; <tt>Float</tt>
438
+
439
+
440
+
441
+
442
+
443
+ </h3><div class="docstring">
444
+ <div class="discussion">
445
+
446
+ <p>Retrieves the age in days.</p>
447
+
448
+
449
+ </div>
450
+ </div>
451
+ <div class="tags">
452
+
453
+ <p class="tag_title">Returns:</p>
454
+ <ul class="return">
455
+
456
+ <li>
457
+
458
+
459
+ <span class='type'>(<tt>Float</tt>)</span>
460
+
461
+
462
+
463
+ &mdash;
464
+ <div class='inline'>
465
+ <p>The age in days, rounded to the second decimal place.</p>
466
+ </div>
467
+
468
+ </li>
469
+
470
+ </ul>
471
+
472
+ </div><table class="source_code">
473
+ <tr>
474
+ <td>
475
+ <pre class="lines">
476
+
477
+
478
+ 34
479
+ 35
480
+ 36
481
+ 37
482
+ 38
483
+ 39</pre>
484
+ </td>
485
+ <td>
486
+ <pre class="code"><span class="info file"># File 'lib/pueri/age.rb', line 34</span>
487
+
488
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_f'>to_f</span>
489
+ <span class='id identifier rubyid_a'>a</span> <span class='op'>=</span> <span class='id identifier rubyid_age'>age</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>*</span> <span class='float'>365.25</span>
490
+ <span class='id identifier rubyid_a'>a</span> <span class='op'>+=</span> <span class='id identifier rubyid_age'>age</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>*</span> <span class='float'>30.0</span>
491
+ <span class='id identifier rubyid_a'>a</span> <span class='op'>+=</span> <span class='id identifier rubyid_age'>age</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span>
492
+ <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
493
+ <span class='kw'>end</span></pre>
494
+ </td>
495
+ </tr>
496
+ </table>
497
+ </div>
498
+
499
+ <div class="method_details ">
500
+ <h3 class="signature " id="to_s-instance_method">
501
+
502
+ #<strong>to_s</strong>(short = false) &#x21d2; <tt>String</tt>
503
+
504
+
505
+
506
+
507
+
508
+ </h3><div class="docstring">
509
+ <div class="discussion">
510
+
511
+ <p>Retrieves the age on a readable format.</p>
512
+
513
+
514
+ </div>
515
+ </div>
516
+ <div class="tags">
517
+ <p class="tag_title">Parameters:</p>
518
+ <ul class="param">
519
+
520
+ <li>
521
+
522
+ <span class='name'>short</span>
523
+
524
+
525
+ <span class='type'>(<tt>Booleann</tt>)</span>
526
+
527
+
528
+ <em class="default">(defaults to: <tt>false</tt>)</em>
529
+
530
+
531
+ &mdash;
532
+ <div class='inline'>
533
+ <p>Whether to output a short-format age or not. Defaults to long format.</p>
534
+ </div>
535
+
536
+ </li>
537
+
538
+ </ul>
539
+
540
+ <p class="tag_title">Returns:</p>
541
+ <ul class="return">
542
+
543
+ <li>
544
+
545
+
546
+ <span class='type'>(<tt>String</tt>)</span>
547
+
548
+
549
+
550
+ &mdash;
551
+ <div class='inline'>
552
+ <p>The age in a readable format, either short or long.</p>
553
+ </div>
554
+
555
+ </li>
556
+
557
+ </ul>
558
+
559
+ </div><table class="source_code">
560
+ <tr>
561
+ <td>
562
+ <pre class="lines">
563
+
564
+
565
+ 23
566
+ 24
567
+ 25
568
+ 26
569
+ 27
570
+ 28
571
+ 29</pre>
572
+ </td>
573
+ <td>
574
+ <pre class="code"><span class="info file"># File 'lib/pueri/age.rb', line 23</span>
575
+
576
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_short'>short</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
577
+ <span class='kw'>if</span> <span class='id identifier rubyid_short'>short</span>
578
+ <span class='id identifier rubyid_short_string'>short_string</span>
579
+ <span class='kw'>else</span>
580
+ <span class='id identifier rubyid_long_string'>long_string</span>
581
+ <span class='kw'>end</span>
582
+ <span class='kw'>end</span></pre>
583
+ </td>
584
+ </tr>
585
+ </table>
586
+ </div>
587
+
588
+ </div>
589
+
590
+ </div>
591
+
592
+ <div id="footer">
593
+ Generated on Sat Oct 19 21:50:31 2019 by
594
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
595
+ 0.9.20 (ruby-2.5.5).
596
+ </div>
597
+
598
+ </div>
599
+ </body>
600
+ </html>