fewald-worklog 0.2.2 → 0.2.3
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/.version +1 -1
- data/lib/daily_log.rb +12 -0
- 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: a96472b19aed7c8be5089c026c81feb764d2b48a2694fd77d7cbbe10cc116639
|
4
|
+
data.tar.gz: 879af891f9009e3c0afe477d4cab68404970647e35a4d82cc8f30f2e3d54964d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a2e2329393e493c533cd092eda4ca1a3db201a36224d80a332eca08f0a1355c1aa61df608388c9d316410715aed7bfdc1b01298004a7a9f24d9fb440d49c69f
|
7
|
+
data.tar.gz: a16ffafc2dafae3796d013f01ec860c1a5b79fd61c81569c1f15ead531632a055c3455d9720c2c295d1bad8cdc32cb6d311db6fec32ca0606517effa953db3ce
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/daily_log.rb
CHANGED
@@ -29,6 +29,18 @@ class DailyLog
|
|
29
29
|
entries.map(&:people).flatten.tally
|
30
30
|
end
|
31
31
|
|
32
|
+
# Returns a sorted list of tags used in the entries for the current day.
|
33
|
+
#
|
34
|
+
# @return [Array<String>]
|
35
|
+
#
|
36
|
+
# @example
|
37
|
+
# log = DailyLog.new(date: Date.today,
|
38
|
+
# entries: [LogEntry.new(message: "Work on something", tags: ['work', 'project'])])
|
39
|
+
# log.tags # => ["project", "work"]
|
40
|
+
def tags
|
41
|
+
entries.flat_map(&:tags).uniq.sort
|
42
|
+
end
|
43
|
+
|
32
44
|
def ==(other)
|
33
45
|
date == other.date && entries == other.entries
|
34
46
|
end
|