timeboss 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/lib/timeboss/calendar/support/translatable.rb +8 -7
- data/lib/timeboss/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7b388d456d8eec7675cc2a654f4f966b6f3f1f00b12e047e49012a135ca2b25
|
4
|
+
data.tar.gz: 8251a808044da5726a9934e10e1f32d7f6fd41c38a6bb16e38632b3e7d4da412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af06d432fc9e1384e4a9e575061b7ca8107bdf7913bfda744c4a8328148e4e2e81d1bfda9f2ece79c2abd1dea49591f06ec349240b6f2e981950f469266deaac
|
7
|
+
data.tar.gz: 7733f507d6d8d96b0d59639d38063cb6b68a4d6ccbb03c02a2e563dfef743e4dc76756628ebe703d04965aa7e7ea02e89f5aebf467733876d9f5ce85f72917bb
|
@@ -10,8 +10,9 @@ module TimeBoss
|
|
10
10
|
|
11
11
|
define_method(periods) { calendar.send("#{periods}_for", self) }
|
12
12
|
|
13
|
-
define_method(period) do
|
13
|
+
define_method(period) do |index = nil|
|
14
14
|
entries = send(periods)
|
15
|
+
return entries[index - 1] unless index.nil?
|
15
16
|
return nil unless entries.length == 1
|
16
17
|
entries.first
|
17
18
|
end
|
@@ -27,7 +28,7 @@ module TimeBoss
|
|
27
28
|
# Get a list of days that fall within this unit.
|
28
29
|
# @return [Array<Calendar::Day>]
|
29
30
|
|
30
|
-
# @!method day
|
31
|
+
# @!method day(index = nil)
|
31
32
|
# Get the day this unit represents.
|
32
33
|
# Returns nil if no single day can be identified.
|
33
34
|
# @return [Array<Calendar::Day>, nil]
|
@@ -38,7 +39,7 @@ module TimeBoss
|
|
38
39
|
# Get a list of weeks that fall within this unit.
|
39
40
|
# @return [Array<Calendar::Week>]
|
40
41
|
|
41
|
-
# @!method week
|
42
|
+
# @!method week(index = nil)
|
42
43
|
# Get the week this unit represents.
|
43
44
|
# Returns nil if no single week can be identified.
|
44
45
|
# @return [Array<Calendar::Week>, nil]
|
@@ -49,7 +50,7 @@ module TimeBoss
|
|
49
50
|
# Get a list of months that fall within this unit.
|
50
51
|
# @return [Array<Calendar::Month>]
|
51
52
|
|
52
|
-
# @!method month
|
53
|
+
# @!method month(index = nil)
|
53
54
|
# Get the month this unit represents.
|
54
55
|
# Returns nil if no single month can be identified.
|
55
56
|
# @return [Array<Calendar::Month>, nil]
|
@@ -60,7 +61,7 @@ module TimeBoss
|
|
60
61
|
# Get a list of quarters that fall within this unit.
|
61
62
|
# @return [Array<Calendar::Quarter>]
|
62
63
|
|
63
|
-
# @!method quarter
|
64
|
+
# @!method quarter(index = nil)
|
64
65
|
# Get the quarter this unit represents.
|
65
66
|
# Returns nil if no single quarter can be identified.
|
66
67
|
# @return [Array<Calendar::Quarter>, nil]
|
@@ -71,7 +72,7 @@ module TimeBoss
|
|
71
72
|
# Get a list of halves that fall within this unit.
|
72
73
|
# @return [Array<Calendar::Half>]
|
73
74
|
|
74
|
-
# @!method half
|
75
|
+
# @!method half(index = nil)
|
75
76
|
# Get the half this unit represents.
|
76
77
|
# Returns nil if no single half can be identified.
|
77
78
|
# @return [Array<Calendar::Half>, nil]
|
@@ -82,7 +83,7 @@ module TimeBoss
|
|
82
83
|
# Get a list of years that fall within this unit.
|
83
84
|
# @return [Array<Calendar::Year>]
|
84
85
|
|
85
|
-
# @!method year
|
86
|
+
# @!method year(index = nil)
|
86
87
|
# Get the year this unit represents.
|
87
88
|
# Returns nil if no single year can be identified.
|
88
89
|
# @return [Array<Calendar::Year>, nil]
|
data/lib/timeboss/version.rb
CHANGED