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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/lib/daily_log.rb +12 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58355177c4287e00546bceb657e475a665a6a0ee374d57e836f220c1e7e57762
4
- data.tar.gz: a071e07481282a7e9d857a32ec7e7fe01d71aff05ed1ededf456a5bef253dca1
3
+ metadata.gz: 6006eac22572b9dfaa7907f122d1f9e1b59ed633abdb58f8e7cff1fd1ae05216
4
+ data.tar.gz: a88c31463ccf65fa26af9ad68b48b0d195ab4c0ee99724eb3cecf5ef694d5ef2
5
5
  SHA512:
6
- metadata.gz: d2b996725ae935188acdfff6c1e71c81ceae62afe2386259a5687e8726967003fad557b0ba8d71bb28d91a13f50138b67a8165643c7a0ce75c33cce4bf5a2cf0
7
- data.tar.gz: 5c5bb1134e3eda63975de71857401d7ae1aae24e264e65be97cee2de9fcf75c0407405478e44afc4238bd4cf6c2aab6615204b7617a25967e32d9978b2382ff3
6
+ metadata.gz: e9a68724ee65d0075d247c29ae0c4fd03790f4943f7ca11e6063c10300da4ca69872c64e3b968a8976824a9627fb781680277b02d76e408f5861b5a9cd90bbc6
7
+ data.tar.gz: 938cd3f3b08fcb78f992e996a2ad3118e8cbbaf680149943f4d6e18da5ddcaf45a8e8806ba3562552946d9a930ca858edb9f4c3b3fff061ccee1dc533ab67d85
data/.version CHANGED
@@ -1 +1 @@
1
- 0.2.5
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fewald-worklog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Friedrich Ewald