fewald-worklog 0.2.5 → 0.2.6
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 -6
- 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: 6006eac22572b9dfaa7907f122d1f9e1b59ed633abdb58f8e7cff1fd1ae05216
|
4
|
+
data.tar.gz: a88c31463ccf65fa26af9ad68b48b0d195ab4c0ee99724eb3cecf5ef694d5ef2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a68724ee65d0075d247c29ae0c4fd03790f4943f7ca11e6063c10300da4ca69872c64e3b968a8976824a9627fb781680277b02d76e408f5861b5a9cd90bbc6
|
7
|
+
data.tar.gz: 938cd3f3b08fcb78f992e996a2ad3118e8cbbaf680149943f4d6e18da5ddcaf45a8e8806ba3562552946d9a930ca858edb9f4c3b3fff061ccee1dc533ab67d85
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
data/lib/daily_log.rb
CHANGED
@@ -15,17 +15,19 @@ class DailyLog
|
|
15
15
|
@entries = params[:entries]
|
16
16
|
end
|
17
17
|
|
18
|
+
# Returns true if there are people mentioned in any entry of the current day.
|
19
|
+
#
|
20
|
+
# @return [Boolean] true if there are people mentioned, false otherwise.
|
18
21
|
def people?
|
19
|
-
# Returns true if there are people mentioned in any entry of the current day.
|
20
22
|
people.size.positive?
|
21
23
|
end
|
22
24
|
|
25
|
+
# Returns a hash of people mentioned in the log for the current day
|
26
|
+
# with the number of times they are mentioned.
|
27
|
+
# People are defined as words starting with @ or ~.
|
28
|
+
#
|
29
|
+
# @return [Hash<String, Integer>]
|
23
30
|
def people
|
24
|
-
# Returns a hash of people mentioned in the log for the current day
|
25
|
-
# with the number of times they are mentioned.
|
26
|
-
# People are defined as words starting with @ or ~.
|
27
|
-
#
|
28
|
-
# @return [Hash<String, Integer>]
|
29
31
|
entries.map(&:people).flatten.tally
|
30
32
|
end
|
31
33
|
|
@@ -41,6 +43,10 @@ class DailyLog
|
|
41
43
|
entries.flat_map(&:tags).uniq.sort
|
42
44
|
end
|
43
45
|
|
46
|
+
# Equals method to compare two DailyLog objects.
|
47
|
+
#
|
48
|
+
# @param other [DailyLog] the other DailyLog object to compare with
|
49
|
+
# @return [Boolean] true if both DailyLog objects have the same date and entries, false otherwise
|
44
50
|
def ==(other)
|
45
51
|
date == other.date && entries == other.entries
|
46
52
|
end
|