timeboss 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. data/.gitignore +2 -0
  5. data/.travis.yml +4 -1
  6. data/.yardopts +1 -0
  7. data/CODE_OF_CONDUCT.md +76 -0
  8. data/README.md +30 -18
  9. data/bin/tbsh +15 -0
  10. data/doc/TimeBoss.html +146 -0
  11. data/doc/TimeBoss/Calendar.html +137 -0
  12. data/doc/TimeBoss/Calendar/Day.html +594 -0
  13. data/doc/TimeBoss/Calendar/Half.html +396 -0
  14. data/doc/TimeBoss/Calendar/Month.html +396 -0
  15. data/doc/TimeBoss/Calendar/Parser.html +386 -0
  16. data/doc/TimeBoss/Calendar/Period.html +841 -0
  17. data/doc/TimeBoss/Calendar/Quarter.html +396 -0
  18. data/doc/TimeBoss/Calendar/Support.html +131 -0
  19. data/doc/TimeBoss/Calendar/Support/Formatter.html +459 -0
  20. data/doc/TimeBoss/Calendar/Support/MonthBased.html +591 -0
  21. data/doc/TimeBoss/Calendar/Support/MonthBasis.html +437 -0
  22. data/doc/TimeBoss/Calendar/Support/MonthlyUnit.html +591 -0
  23. data/doc/TimeBoss/Calendar/Support/Navigable.html +723 -0
  24. data/doc/TimeBoss/Calendar/Support/Shiftable.html +138 -0
  25. data/doc/TimeBoss/Calendar/Support/Unit.html +1299 -0
  26. data/doc/TimeBoss/Calendar/Waypoints.html +155 -0
  27. data/doc/TimeBoss/Calendar/Waypoints/Absolute.html +1378 -0
  28. data/doc/TimeBoss/Calendar/Waypoints/Relative.html +4308 -0
  29. data/doc/TimeBoss/Calendar/Week.html +671 -0
  30. data/doc/TimeBoss/Calendar/Year.html +319 -0
  31. data/doc/TimeBoss/Calendars.html +336 -0
  32. data/doc/TimeBoss/Calendars/Broadcast.html +221 -0
  33. data/doc/TimeBoss/Calendars/Broadcast/Basis.html +278 -0
  34. data/doc/TimeBoss/Calendars/Entry.html +399 -0
  35. data/doc/TimeBoss/Support.html +115 -0
  36. data/doc/TimeBoss/Support/Shellable.html +249 -0
  37. data/doc/_index.html +416 -0
  38. data/doc/class_list.html +51 -0
  39. data/doc/css/common.css +1 -0
  40. data/doc/css/full_list.css +58 -0
  41. data/doc/css/style.css +496 -0
  42. data/doc/file.README.html +299 -0
  43. data/doc/file_list.html +56 -0
  44. data/doc/frames.html +17 -0
  45. data/doc/index.html +299 -0
  46. data/doc/js/app.js +314 -0
  47. data/doc/js/full_list.js +216 -0
  48. data/doc/js/jquery.js +4 -0
  49. data/doc/method_list.html +1139 -0
  50. data/doc/top-level-namespace.html +110 -0
  51. data/lib/tasks/calendars.rake +5 -0
  52. data/lib/timeboss.rb +4 -0
  53. data/lib/timeboss/calendar.rb +22 -0
  54. data/lib/timeboss/calendar/day.rb +19 -6
  55. data/lib/timeboss/calendar/half.rb +7 -2
  56. data/lib/timeboss/calendar/month.rb +7 -2
  57. data/lib/timeboss/calendar/parser.rb +1 -0
  58. data/lib/timeboss/calendar/period.rb +26 -11
  59. data/lib/timeboss/calendar/quarter.rb +7 -2
  60. data/lib/timeboss/calendar/support.rb +8 -0
  61. data/lib/timeboss/calendar/support/formatter.rb +1 -0
  62. data/lib/timeboss/calendar/support/month_basis.rb +3 -0
  63. data/lib/timeboss/calendar/support/{month_based.rb → monthly_unit.rb} +24 -18
  64. data/lib/timeboss/calendar/support/navigable.rb +73 -0
  65. data/lib/timeboss/calendar/support/shiftable.rb +3 -2
  66. data/lib/timeboss/calendar/support/unit.rb +26 -0
  67. data/lib/timeboss/calendar/waypoints.rb +6 -80
  68. data/lib/timeboss/calendar/waypoints/absolute.rb +114 -0
  69. data/lib/timeboss/calendar/waypoints/relative.rb +268 -0
  70. data/lib/timeboss/calendar/week.rb +26 -18
  71. data/lib/timeboss/calendar/year.rb +6 -5
  72. data/lib/timeboss/calendars.rb +20 -3
  73. data/lib/timeboss/version.rb +1 -1
  74. data/spec/calendar/day_spec.rb +1 -1
  75. data/spec/calendar/support/{month_based_spec.rb → monthly_unit_spec.rb} +18 -8
  76. data/spec/calendar/week_spec.rb +5 -13
  77. data/spec/calendars/broadcast_spec.rb +27 -7
  78. data/spec/calendars_spec.rb +7 -1
  79. data/timeboss.gemspec +1 -0
  80. metadata +77 -8
@@ -0,0 +1,138 @@
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
+ Module: TimeBoss::Calendar::Support::Shiftable
8
+
9
+ &mdash; Documentation by YARD 0.9.25
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "TimeBoss::Calendar::Support::Shiftable";
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 (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../TimeBoss.html" title="TimeBoss (module)">TimeBoss</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Calendar.html" title="TimeBoss::Calendar (module)">Calendar</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Support.html" title="TimeBoss::Calendar::Support (module)">Support</a></span></span>
41
+ &raquo;
42
+ <span class="title">Shiftable</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>Module: TimeBoss::Calendar::Support::Shiftable
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="Unit.html" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/timeboss/calendar/support/shiftable.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+
94
+ <p>Provides the ability to take a unit, and shift it into a different period,
95
+ relative to today.</p>
96
+
97
+
98
+ </div>
99
+ </div>
100
+ <div class="tags">
101
+
102
+
103
+ </div>
104
+
105
+ <h2>
106
+ Constant Summary
107
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
108
+ </h2>
109
+
110
+ <dl class="constants">
111
+
112
+ <dt id="PERIODS-constant" class="">PERIODS =
113
+
114
+ </dt>
115
+ <dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='tstring_content'>day</span><span class='words_sep'> </span><span class='tstring_content'>week</span><span class='words_sep'> </span><span class='tstring_content'>month</span><span class='words_sep'> </span><span class='tstring_content'>quarter</span><span class='words_sep'> </span><span class='tstring_content'>half</span><span class='words_sep'> </span><span class='tstring_content'>year</span><span class='words_sep'>]</span></pre></dd>
116
+
117
+ </dl>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ </div>
129
+
130
+ <div id="footer">
131
+ Generated on Sun Jul 19 10:12:10 2020 by
132
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
+ 0.9.25 (ruby-2.4.1).
134
+ </div>
135
+
136
+ </div>
137
+ </body>
138
+ </html>
@@ -0,0 +1,1299 @@
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: TimeBoss::Calendar::Support::Unit
8
+
9
+ &mdash; Documentation by YARD 0.9.25
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "TimeBoss::Calendar::Support::Unit";
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 (U)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../TimeBoss.html" title="TimeBoss (module)">TimeBoss</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Calendar.html" title="TimeBoss::Calendar (module)">Calendar</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Support.html" title="TimeBoss::Calendar::Support (module)">Support</a></span></span>
41
+ &raquo;
42
+ <span class="title">Unit</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: TimeBoss::Calendar::Support::Unit
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">TimeBoss::Calendar::Support::Unit</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd><span class='object_link'><a href="Navigable.html" title="TimeBoss::Calendar::Support::Navigable (module)">Navigable</a></span>, <span class='object_link'><a href="Shiftable.html" title="TimeBoss::Calendar::Support::Shiftable (module)">Shiftable</a></span></dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/timeboss/calendar/support/unit.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>A unit is the lowest-level base of all days/weeks/months, etc.</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+
118
+ </div><div id="subclasses">
119
+ <h2>Direct Known Subclasses</h2>
120
+ <p class="children"><span class='object_link'><a href="../Day.html" title="TimeBoss::Calendar::Day (class)">Day</a></span>, <span class='object_link'><a href="MonthlyUnit.html" title="TimeBoss::Calendar::Support::MonthlyUnit (class)">MonthlyUnit</a></span>, <span class='object_link'><a href="../Week.html" title="TimeBoss::Calendar::Week (class)">Week</a></span></p>
121
+ </div>
122
+
123
+
124
+
125
+ <h2>Constant Summary</h2>
126
+
127
+ <h3 class="inherited">Constants included
128
+ from <span class='object_link'><a href="Shiftable.html" title="TimeBoss::Calendar::Support::Shiftable (module)">Shiftable</a></span></h3>
129
+ <p class="inherited"><span class='object_link'><a href="Shiftable.html#PERIODS-constant" title="TimeBoss::Calendar::Support::Shiftable::PERIODS (constant)">Shiftable::PERIODS</a></span></p>
130
+
131
+
132
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
133
+ <ul class="summary">
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#calendar-instance_method" title="#calendar (instance method)">#<strong>calendar</strong> &#x21d2; Object </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+ <span class="note title readonly">readonly</span>
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ <span class="summary_desc"><div class='inline'>
158
+ <p>Returns the value of attribute calendar.</p>
159
+ </div></span>
160
+
161
+ </li>
162
+
163
+
164
+ <li class="public ">
165
+ <span class="summary_signature">
166
+
167
+ <a href="#end_date-instance_method" title="#end_date (instance method)">#<strong>end_date</strong> &#x21d2; Object </a>
168
+
169
+
170
+
171
+ </span>
172
+
173
+
174
+
175
+
176
+ <span class="note title readonly">readonly</span>
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+ <span class="summary_desc"><div class='inline'>
187
+ <p>Returns the value of attribute end_date.</p>
188
+ </div></span>
189
+
190
+ </li>
191
+
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#start_date-instance_method" title="#start_date (instance method)">#<strong>start_date</strong> &#x21d2; Object </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+
204
+
205
+ <span class="note title readonly">readonly</span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'>
216
+ <p>Returns the value of attribute start_date.</p>
217
+ </div></span>
218
+
219
+ </li>
220
+
221
+
222
+ </ul>
223
+
224
+
225
+
226
+
227
+
228
+ <h2>
229
+ Class Method Summary
230
+ <small><a href="#" class="summary_toggle">collapse</a></small>
231
+ </h2>
232
+
233
+ <ul class="summary">
234
+
235
+ <li class="public ">
236
+ <span class="summary_signature">
237
+
238
+ <a href="#type-class_method" title="type (class method)">.<strong>type</strong> &#x21d2; Object </a>
239
+
240
+
241
+
242
+ </span>
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+ <span class="summary_desc"><div class='inline'></div></span>
253
+
254
+ </li>
255
+
256
+
257
+ </ul>
258
+
259
+ <h2>
260
+ Instance Method Summary
261
+ <small><a href="#" class="summary_toggle">collapse</a></small>
262
+ </h2>
263
+
264
+ <ul class="summary">
265
+
266
+ <li class="public ">
267
+ <span class="summary_signature">
268
+
269
+ <a href="#%2B-instance_method" title="#+ (instance method)">#<strong>+</strong>(value) &#x21d2; Unit </a>
270
+
271
+
272
+
273
+ </span>
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+ <span class="summary_desc"><div class='inline'>
284
+ <p>Move some number of units forward from this unit.</p>
285
+ </div></span>
286
+
287
+ </li>
288
+
289
+
290
+ <li class="public ">
291
+ <span class="summary_signature">
292
+
293
+ <a href="#--instance_method" title="#- (instance method)">#<strong>-</strong>(value) &#x21d2; Unit </a>
294
+
295
+
296
+
297
+ </span>
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+ <span class="summary_desc"><div class='inline'>
308
+ <p>Move some number of units backward from this unit.</p>
309
+ </div></span>
310
+
311
+ </li>
312
+
313
+
314
+ <li class="public ">
315
+ <span class="summary_signature">
316
+
317
+ <a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(entry) &#x21d2; Boolean </a>
318
+
319
+
320
+
321
+ </span>
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+ <span class="summary_desc"><div class='inline'>
332
+ <p>Is the specified unit equal to this one, based on its unit type and date
333
+ range?.</p>
334
+ </div></span>
335
+
336
+ </li>
337
+
338
+
339
+ <li class="public ">
340
+ <span class="summary_signature">
341
+
342
+ <a href="#current%3F-instance_method" title="#current? (instance method)">#<strong>current?</strong> &#x21d2; Boolean </a>
343
+
344
+
345
+
346
+ </span>
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+ <span class="summary_desc"><div class='inline'>
357
+ <p>Does this period cover the current date?.</p>
358
+ </div></span>
359
+
360
+ </li>
361
+
362
+
363
+ <li class="public ">
364
+ <span class="summary_signature">
365
+
366
+ <a href="#format-instance_method" title="#format (instance method)">#<strong>format</strong>(*periods) &#x21d2; String </a>
367
+
368
+
369
+
370
+ </span>
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+ <span class="summary_desc"><div class='inline'>
381
+ <p>Format this period based on specified granularities.</p>
382
+ </div></span>
383
+
384
+ </li>
385
+
386
+
387
+ <li class="public ">
388
+ <span class="summary_signature">
389
+
390
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(calendar, start_date, end_date) &#x21d2; Unit </a>
391
+
392
+
393
+
394
+ </span>
395
+
396
+
397
+ <span class="note title constructor">constructor</span>
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+ <span class="summary_desc"><div class='inline'>
407
+ <p>A new instance of Unit.</p>
408
+ </div></span>
409
+
410
+ </li>
411
+
412
+
413
+ <li class="public ">
414
+ <span class="summary_signature">
415
+
416
+ <a href="#offset-instance_method" title="#offset (instance method)">#<strong>offset</strong>(value) &#x21d2; Unit </a>
417
+
418
+
419
+
420
+ </span>
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+ <span class="summary_desc"><div class='inline'>
431
+ <p>Return the unit relative to this one by the specified offset.</p>
432
+ </div></span>
433
+
434
+ </li>
435
+
436
+
437
+ <li class="public ">
438
+ <span class="summary_signature">
439
+
440
+ <a href="#thru-instance_method" title="#thru (instance method)">#<strong>thru</strong>(unit) &#x21d2; Period </a>
441
+
442
+
443
+
444
+ </span>
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+ <span class="summary_desc"><div class='inline'>
455
+ <p>Starting from this unit of time, build a period extending through the
456
+ specified time unit.</p>
457
+ </div></span>
458
+
459
+ </li>
460
+
461
+
462
+ <li class="public ">
463
+ <span class="summary_signature">
464
+
465
+ <a href="#to_range-instance_method" title="#to_range (instance method)">#<strong>to_range</strong> &#x21d2; Range&lt;Date, Date&gt; </a>
466
+
467
+
468
+
469
+ </span>
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+ <span class="summary_desc"><div class='inline'>
480
+ <p>Express this period as a date range.</p>
481
+ </div></span>
482
+
483
+ </li>
484
+
485
+
486
+ </ul>
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Navigable.html" title="TimeBoss::Calendar::Support::Navigable (module)">Navigable</a></span></h3>
505
+ <p class="inherited"><span class='object_link'><a href="Navigable.html#ago-instance_method" title="TimeBoss::Calendar::Support::Navigable#ago (method)">#ago</a></span>, <span class='object_link'><a href="Navigable.html#ahead-instance_method" title="TimeBoss::Calendar::Support::Navigable#ahead (method)">#ahead</a></span>, <span class='object_link'><a href="Navigable.html#next-instance_method" title="TimeBoss::Calendar::Support::Navigable#next (method)">#next</a></span>, <span class='object_link'><a href="Navigable.html#previous-instance_method" title="TimeBoss::Calendar::Support::Navigable#previous (method)">#previous</a></span>, <span class='object_link'><a href="Navigable.html#until-instance_method" title="TimeBoss::Calendar::Support::Navigable#until (method)">#until</a></span></p>
506
+ <div id="constructor_details" class="method_details_list">
507
+ <h2>Constructor Details</h2>
508
+
509
+ <div class="method_details first">
510
+ <h3 class="signature first" id="initialize-instance_method">
511
+
512
+ #<strong>initialize</strong>(calendar, start_date, end_date) &#x21d2; <tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>
513
+
514
+
515
+
516
+
517
+
518
+ </h3><div class="docstring">
519
+ <div class="discussion">
520
+
521
+ <p>Returns a new instance of Unit.</p>
522
+
523
+
524
+ </div>
525
+ </div>
526
+ <div class="tags">
527
+
528
+
529
+ </div><table class="source_code">
530
+ <tr>
531
+ <td>
532
+ <pre class="lines">
533
+
534
+
535
+ 19
536
+ 20
537
+ 21
538
+ 22
539
+ 23</pre>
540
+ </td>
541
+ <td>
542
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 19</span>
543
+
544
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_calendar'>calendar</span><span class='comma'>,</span> <span class='id identifier rubyid_start_date'>start_date</span><span class='comma'>,</span> <span class='id identifier rubyid_end_date'>end_date</span><span class='rparen'>)</span>
545
+ <span class='ivar'>@calendar</span> <span class='op'>=</span> <span class='id identifier rubyid_calendar'>calendar</span>
546
+ <span class='ivar'>@start_date</span> <span class='op'>=</span> <span class='id identifier rubyid_start_date'>start_date</span>
547
+ <span class='ivar'>@end_date</span> <span class='op'>=</span> <span class='id identifier rubyid_end_date'>end_date</span>
548
+ <span class='kw'>end</span></pre>
549
+ </td>
550
+ </tr>
551
+ </table>
552
+ </div>
553
+
554
+ </div>
555
+
556
+ <div id="instance_attr_details" class="attr_details">
557
+ <h2>Instance Attribute Details</h2>
558
+
559
+
560
+ <span id=""></span>
561
+ <div class="method_details first">
562
+ <h3 class="signature first" id="calendar-instance_method">
563
+
564
+ #<strong>calendar</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
565
+
566
+
567
+
568
+
569
+
570
+ </h3><div class="docstring">
571
+ <div class="discussion">
572
+
573
+ <p>Returns the value of attribute calendar.</p>
574
+
575
+
576
+ </div>
577
+ </div>
578
+ <div class="tags">
579
+
580
+
581
+ </div><table class="source_code">
582
+ <tr>
583
+ <td>
584
+ <pre class="lines">
585
+
586
+
587
+ 13
588
+ 14
589
+ 15</pre>
590
+ </td>
591
+ <td>
592
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 13</span>
593
+
594
+ <span class='kw'>def</span> <span class='id identifier rubyid_calendar'>calendar</span>
595
+ <span class='ivar'>@calendar</span>
596
+ <span class='kw'>end</span></pre>
597
+ </td>
598
+ </tr>
599
+ </table>
600
+ </div>
601
+
602
+
603
+ <span id=""></span>
604
+ <div class="method_details ">
605
+ <h3 class="signature " id="end_date-instance_method">
606
+
607
+ #<strong>end_date</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
608
+
609
+
610
+
611
+
612
+
613
+ </h3><div class="docstring">
614
+ <div class="discussion">
615
+
616
+ <p>Returns the value of attribute end_date.</p>
617
+
618
+
619
+ </div>
620
+ </div>
621
+ <div class="tags">
622
+
623
+
624
+ </div><table class="source_code">
625
+ <tr>
626
+ <td>
627
+ <pre class="lines">
628
+
629
+
630
+ 13
631
+ 14
632
+ 15</pre>
633
+ </td>
634
+ <td>
635
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 13</span>
636
+
637
+ <span class='kw'>def</span> <span class='id identifier rubyid_end_date'>end_date</span>
638
+ <span class='ivar'>@end_date</span>
639
+ <span class='kw'>end</span></pre>
640
+ </td>
641
+ </tr>
642
+ </table>
643
+ </div>
644
+
645
+
646
+ <span id=""></span>
647
+ <div class="method_details ">
648
+ <h3 class="signature " id="start_date-instance_method">
649
+
650
+ #<strong>start_date</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
651
+
652
+
653
+
654
+
655
+
656
+ </h3><div class="docstring">
657
+ <div class="discussion">
658
+
659
+ <p>Returns the value of attribute start_date.</p>
660
+
661
+
662
+ </div>
663
+ </div>
664
+ <div class="tags">
665
+
666
+
667
+ </div><table class="source_code">
668
+ <tr>
669
+ <td>
670
+ <pre class="lines">
671
+
672
+
673
+ 13
674
+ 14
675
+ 15</pre>
676
+ </td>
677
+ <td>
678
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 13</span>
679
+
680
+ <span class='kw'>def</span> <span class='id identifier rubyid_start_date'>start_date</span>
681
+ <span class='ivar'>@start_date</span>
682
+ <span class='kw'>end</span></pre>
683
+ </td>
684
+ </tr>
685
+ </table>
686
+ </div>
687
+
688
+ </div>
689
+
690
+
691
+ <div id="class_method_details" class="method_details_list">
692
+ <h2>Class Method Details</h2>
693
+
694
+
695
+ <div class="method_details first">
696
+ <h3 class="signature first" id="type-class_method">
697
+
698
+ .<strong>type</strong> &#x21d2; <tt>Object</tt>
699
+
700
+
701
+
702
+
703
+
704
+ </h3><table class="source_code">
705
+ <tr>
706
+ <td>
707
+ <pre class="lines">
708
+
709
+
710
+ 15
711
+ 16
712
+ 17</pre>
713
+ </td>
714
+ <td>
715
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 15</span>
716
+
717
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
718
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_demodulize'>demodulize</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span>
719
+ <span class='kw'>end</span></pre>
720
+ </td>
721
+ </tr>
722
+ </table>
723
+ </div>
724
+
725
+ </div>
726
+
727
+ <div id="instance_method_details" class="method_details_list">
728
+ <h2>Instance Method Details</h2>
729
+
730
+
731
+ <div class="method_details first">
732
+ <h3 class="signature first" id="+-instance_method">
733
+
734
+ #<strong>+</strong>(value) &#x21d2; <tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>
735
+
736
+
737
+
738
+
739
+
740
+ </h3><div class="docstring">
741
+ <div class="discussion">
742
+
743
+ <p>Move some number of units forward from this unit.</p>
744
+
745
+
746
+ </div>
747
+ </div>
748
+ <div class="tags">
749
+ <p class="tag_title">Parameters:</p>
750
+ <ul class="param">
751
+
752
+ <li>
753
+
754
+ <span class='name'>value</span>
755
+
756
+
757
+ <span class='type'>(<tt>Integer</tt>)</span>
758
+
759
+
760
+
761
+ </li>
762
+
763
+ </ul>
764
+
765
+ <p class="tag_title">Returns:</p>
766
+ <ul class="return">
767
+
768
+ <li>
769
+
770
+
771
+ <span class='type'>(<tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>)</span>
772
+
773
+
774
+
775
+ </li>
776
+
777
+ </ul>
778
+
779
+ </div><table class="source_code">
780
+ <tr>
781
+ <td>
782
+ <pre class="lines">
783
+
784
+
785
+ 66
786
+ 67
787
+ 68</pre>
788
+ </td>
789
+ <td>
790
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 66</span>
791
+
792
+ <span class='kw'>def</span> <span class='op'>+</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
793
+ <span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
794
+ <span class='kw'>end</span></pre>
795
+ </td>
796
+ </tr>
797
+ </table>
798
+ </div>
799
+
800
+ <div class="method_details ">
801
+ <h3 class="signature " id="--instance_method">
802
+
803
+ #<strong>-</strong>(value) &#x21d2; <tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>
804
+
805
+
806
+
807
+
808
+
809
+ </h3><div class="docstring">
810
+ <div class="discussion">
811
+
812
+ <p>Move some number of units backward from this unit.</p>
813
+
814
+
815
+ </div>
816
+ </div>
817
+ <div class="tags">
818
+ <p class="tag_title">Parameters:</p>
819
+ <ul class="param">
820
+
821
+ <li>
822
+
823
+ <span class='name'>value</span>
824
+
825
+
826
+ <span class='type'>(<tt>Integer</tt>)</span>
827
+
828
+
829
+
830
+ </li>
831
+
832
+ </ul>
833
+
834
+ <p class="tag_title">Returns:</p>
835
+ <ul class="return">
836
+
837
+ <li>
838
+
839
+
840
+ <span class='type'>(<tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>)</span>
841
+
842
+
843
+
844
+ </li>
845
+
846
+ </ul>
847
+
848
+ </div><table class="source_code">
849
+ <tr>
850
+ <td>
851
+ <pre class="lines">
852
+
853
+
854
+ 73
855
+ 74
856
+ 75</pre>
857
+ </td>
858
+ <td>
859
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 73</span>
860
+
861
+ <span class='kw'>def</span> <span class='op'>-</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
862
+ <span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='op'>-</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
863
+ <span class='kw'>end</span></pre>
864
+ </td>
865
+ </tr>
866
+ </table>
867
+ </div>
868
+
869
+ <div class="method_details ">
870
+ <h3 class="signature " id="==-instance_method">
871
+
872
+ #<strong>==</strong>(entry) &#x21d2; <tt>Boolean</tt>
873
+
874
+
875
+
876
+
877
+
878
+ </h3><div class="docstring">
879
+ <div class="discussion">
880
+
881
+ <p>Is the specified unit equal to this one, based on its unit type and date
882
+ range?</p>
883
+
884
+
885
+ </div>
886
+ </div>
887
+ <div class="tags">
888
+ <p class="tag_title">Parameters:</p>
889
+ <ul class="param">
890
+
891
+ <li>
892
+
893
+ <span class='name'>entry</span>
894
+
895
+
896
+ <span class='type'>(<tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>)</span>
897
+
898
+
899
+
900
+ &mdash;
901
+ <div class='inline'>
902
+ <p>the unit to compare</p>
903
+ </div>
904
+
905
+ </li>
906
+
907
+ </ul>
908
+
909
+ <p class="tag_title">Returns:</p>
910
+ <ul class="return">
911
+
912
+ <li>
913
+
914
+
915
+ <span class='type'>(<tt>Boolean</tt>)</span>
916
+
917
+
918
+
919
+ &mdash;
920
+ <div class='inline'>
921
+ <p>true when periods are equal</p>
922
+ </div>
923
+
924
+ </li>
925
+
926
+ </ul>
927
+
928
+ </div><table class="source_code">
929
+ <tr>
930
+ <td>
931
+ <pre class="lines">
932
+
933
+
934
+ 28
935
+ 29
936
+ 30</pre>
937
+ </td>
938
+ <td>
939
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 28</span>
940
+
941
+ <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
942
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_start_date'>start_date</span> <span class='op'>==</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_start_date'>start_date</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_end_date'>end_date</span> <span class='op'>==</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_end_date'>end_date</span>
943
+ <span class='kw'>end</span></pre>
944
+ </td>
945
+ </tr>
946
+ </table>
947
+ </div>
948
+
949
+ <div class="method_details ">
950
+ <h3 class="signature " id="current?-instance_method">
951
+
952
+ #<strong>current?</strong> &#x21d2; <tt>Boolean</tt>
953
+
954
+
955
+
956
+
957
+
958
+ </h3><div class="docstring">
959
+ <div class="discussion">
960
+
961
+ <p>Does this period cover the current date?</p>
962
+
963
+
964
+ </div>
965
+ </div>
966
+ <div class="tags">
967
+
968
+ <p class="tag_title">Returns:</p>
969
+ <ul class="return">
970
+
971
+ <li>
972
+
973
+
974
+ <span class='type'>(<tt>Boolean</tt>)</span>
975
+
976
+
977
+
978
+ </li>
979
+
980
+ </ul>
981
+
982
+ </div><table class="source_code">
983
+ <tr>
984
+ <td>
985
+ <pre class="lines">
986
+
987
+
988
+ 48
989
+ 49
990
+ 50</pre>
991
+ </td>
992
+ <td>
993
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 48</span>
994
+
995
+ <span class='kw'>def</span> <span class='id identifier rubyid_current?'>current?</span>
996
+ <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_between?'>between?</span><span class='lparen'>(</span><span class='id identifier rubyid_start_date'>start_date</span><span class='comma'>,</span> <span class='id identifier rubyid_end_date'>end_date</span><span class='rparen'>)</span>
997
+ <span class='kw'>end</span></pre>
998
+ </td>
999
+ </tr>
1000
+ </table>
1001
+ </div>
1002
+
1003
+ <div class="method_details ">
1004
+ <h3 class="signature " id="format-instance_method">
1005
+
1006
+ #<strong>format</strong>(*periods) &#x21d2; <tt>String</tt>
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+ </h3><div class="docstring">
1013
+ <div class="discussion">
1014
+
1015
+ <p>Format this period based on specified granularities.</p>
1016
+
1017
+
1018
+ </div>
1019
+ </div>
1020
+ <div class="tags">
1021
+ <p class="tag_title">Parameters:</p>
1022
+ <ul class="param">
1023
+
1024
+ <li>
1025
+
1026
+ <span class='name'>periods</span>
1027
+
1028
+
1029
+ <span class='type'>(<tt>Array&lt;Symbol, String&gt;</tt>)</span>
1030
+
1031
+
1032
+
1033
+ &mdash;
1034
+ <div class='inline'>
1035
+ <p>the periods to include (`half, week`, or `quarter`)</p>
1036
+ </div>
1037
+
1038
+ </li>
1039
+
1040
+ </ul>
1041
+
1042
+ <p class="tag_title">Returns:</p>
1043
+ <ul class="return">
1044
+
1045
+ <li>
1046
+
1047
+
1048
+ <span class='type'>(<tt>String</tt>)</span>
1049
+
1050
+
1051
+
1052
+ &mdash;
1053
+ <div class='inline'>
1054
+ <p>(e.g. “2020H2W7” or “2020Q3”)</p>
1055
+ </div>
1056
+
1057
+ </li>
1058
+
1059
+ </ul>
1060
+
1061
+ </div><table class="source_code">
1062
+ <tr>
1063
+ <td>
1064
+ <pre class="lines">
1065
+
1066
+
1067
+ 35
1068
+ 36
1069
+ 37</pre>
1070
+ </td>
1071
+ <td>
1072
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 35</span>
1073
+
1074
+ <span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_periods'>periods</span><span class='rparen'>)</span>
1075
+ <span class='const'><span class='object_link'><a href="Formatter.html" title="TimeBoss::Calendar::Support::Formatter (class)">Formatter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Formatter.html#initialize-instance_method" title="TimeBoss::Calendar::Support::Formatter#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_periods'>periods</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="Formatter.html" title="TimeBoss::Calendar::Support::Formatter (class)">Formatter</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Formatter.html#PERIODS-constant" title="TimeBoss::Calendar::Support::Formatter::PERIODS (constant)">PERIODS</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'><span class='object_link'><a href="Formatter.html#to_s-instance_method" title="TimeBoss::Calendar::Support::Formatter#to_s (method)">to_s</a></span></span>
1076
+ <span class='kw'>end</span></pre>
1077
+ </td>
1078
+ </tr>
1079
+ </table>
1080
+ </div>
1081
+
1082
+ <div class="method_details ">
1083
+ <h3 class="signature " id="offset-instance_method">
1084
+
1085
+ #<strong>offset</strong>(value) &#x21d2; <tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>
1086
+
1087
+
1088
+
1089
+
1090
+
1091
+ </h3><div class="docstring">
1092
+ <div class="discussion">
1093
+
1094
+ <p>Return the unit relative to this one by the specified offset. Offset values
1095
+ can be positive or negative.</p>
1096
+
1097
+
1098
+ </div>
1099
+ </div>
1100
+ <div class="tags">
1101
+ <p class="tag_title">Parameters:</p>
1102
+ <ul class="param">
1103
+
1104
+ <li>
1105
+
1106
+ <span class='name'>value</span>
1107
+
1108
+
1109
+ <span class='type'>(<tt>Integer</tt>)</span>
1110
+
1111
+
1112
+
1113
+ </li>
1114
+
1115
+ </ul>
1116
+
1117
+ <p class="tag_title">Returns:</p>
1118
+ <ul class="return">
1119
+
1120
+ <li>
1121
+
1122
+
1123
+ <span class='type'>(<tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>)</span>
1124
+
1125
+
1126
+
1127
+ </li>
1128
+
1129
+ </ul>
1130
+
1131
+ </div><table class="source_code">
1132
+ <tr>
1133
+ <td>
1134
+ <pre class="lines">
1135
+
1136
+
1137
+ 56
1138
+ 57
1139
+ 58
1140
+ 59
1141
+ 60
1142
+ 61</pre>
1143
+ </td>
1144
+ <td>
1145
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 56</span>
1146
+
1147
+ <span class='kw'>def</span> <span class='id identifier rubyid_offset'>offset</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1148
+ <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_negative?'>negative?</span> <span class='op'>?</span> <span class='symbol'>:previous</span> <span class='op'>:</span> <span class='symbol'>:next</span>
1149
+ <span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='kw'>self</span>
1150
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_abs'>abs</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1151
+ <span class='id identifier rubyid_base'>base</span>
1152
+ <span class='kw'>end</span></pre>
1153
+ </td>
1154
+ </tr>
1155
+ </table>
1156
+ </div>
1157
+
1158
+ <div class="method_details ">
1159
+ <h3 class="signature " id="thru-instance_method">
1160
+
1161
+ #<strong>thru</strong>(unit) &#x21d2; <tt><span class='object_link'><a href="../Period.html" title="TimeBoss::Calendar::Period (class)">Period</a></span></tt>
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+ </h3><div class="docstring">
1168
+ <div class="discussion">
1169
+
1170
+ <p>Starting from this unit of time, build a period extending through the
1171
+ specified time unit.</p>
1172
+
1173
+
1174
+ </div>
1175
+ </div>
1176
+ <div class="tags">
1177
+ <p class="tag_title">Parameters:</p>
1178
+ <ul class="param">
1179
+
1180
+ <li>
1181
+
1182
+ <span class='name'>unit</span>
1183
+
1184
+
1185
+ <span class='type'>(<tt><span class='object_link'><a href="" title="TimeBoss::Calendar::Support::Unit (class)">Unit</a></span></tt>)</span>
1186
+
1187
+
1188
+
1189
+ &mdash;
1190
+ <div class='inline'>
1191
+ <p>the period to extend through</p>
1192
+ </div>
1193
+
1194
+ </li>
1195
+
1196
+ </ul>
1197
+
1198
+ <p class="tag_title">Returns:</p>
1199
+ <ul class="return">
1200
+
1201
+ <li>
1202
+
1203
+
1204
+ <span class='type'>(<tt><span class='object_link'><a href="../Period.html" title="TimeBoss::Calendar::Period (class)">Period</a></span></tt>)</span>
1205
+
1206
+
1207
+
1208
+ </li>
1209
+
1210
+ </ul>
1211
+
1212
+ </div><table class="source_code">
1213
+ <tr>
1214
+ <td>
1215
+ <pre class="lines">
1216
+
1217
+
1218
+ 42
1219
+ 43
1220
+ 44</pre>
1221
+ </td>
1222
+ <td>
1223
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 42</span>
1224
+
1225
+ <span class='kw'>def</span> <span class='id identifier rubyid_thru'>thru</span><span class='lparen'>(</span><span class='id identifier rubyid_unit'>unit</span><span class='rparen'>)</span>
1226
+ <span class='const'><span class='object_link'><a href="../Period.html" title="TimeBoss::Calendar::Period (class)">Period</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_calendar'>calendar</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_unit'>unit</span><span class='rparen'>)</span>
1227
+ <span class='kw'>end</span></pre>
1228
+ </td>
1229
+ </tr>
1230
+ </table>
1231
+ </div>
1232
+
1233
+ <div class="method_details ">
1234
+ <h3 class="signature " id="to_range-instance_method">
1235
+
1236
+ #<strong>to_range</strong> &#x21d2; <tt>Range&lt;Date, Date&gt;</tt>
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+ </h3><div class="docstring">
1243
+ <div class="discussion">
1244
+
1245
+ <p>Express this period as a date range.</p>
1246
+
1247
+
1248
+ </div>
1249
+ </div>
1250
+ <div class="tags">
1251
+
1252
+ <p class="tag_title">Returns:</p>
1253
+ <ul class="return">
1254
+
1255
+ <li>
1256
+
1257
+
1258
+ <span class='type'>(<tt>Range&lt;Date, Date&gt;</tt>)</span>
1259
+
1260
+
1261
+
1262
+ </li>
1263
+
1264
+ </ul>
1265
+
1266
+ </div><table class="source_code">
1267
+ <tr>
1268
+ <td>
1269
+ <pre class="lines">
1270
+
1271
+
1272
+ 79
1273
+ 80
1274
+ 81</pre>
1275
+ </td>
1276
+ <td>
1277
+ <pre class="code"><span class="info file"># File 'lib/timeboss/calendar/support/unit.rb', line 79</span>
1278
+
1279
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_range'>to_range</span>
1280
+ <span class='ivar'>@_to_range</span> <span class='op'>||=</span> <span class='id identifier rubyid_start_date'>start_date</span> <span class='op'>..</span> <span class='id identifier rubyid_end_date'>end_date</span>
1281
+ <span class='kw'>end</span></pre>
1282
+ </td>
1283
+ </tr>
1284
+ </table>
1285
+ </div>
1286
+
1287
+ </div>
1288
+
1289
+ </div>
1290
+
1291
+ <div id="footer">
1292
+ Generated on Sun Jul 19 10:12:11 2020 by
1293
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1294
+ 0.9.25 (ruby-2.4.1).
1295
+ </div>
1296
+
1297
+ </div>
1298
+ </body>
1299
+ </html>