fewald-worklog 0.2.33 → 0.2.34
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 +11 -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: 6325a91f9d1eb681031b23a92d66a80cc6eabe7e789305ac42a6b9264efc4ac8
|
|
4
|
+
data.tar.gz: d86f5ad7e2a5122a394801b3b4291dc47b3a5657469321cb231c0d60ed297e71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71e6ed726460339b93a19dfad1ce7445490c813f0c5e4e6f5db37505168daa1ba04d9fa5094393a38f91fc7270ade0b88879887c6a179dac0a822ffb87c96720
|
|
7
|
+
data.tar.gz: a140db08e98ffb970eb98dd3d1c28e3e3dec1d284ea1ef005e68c6c1e071195abb39a37afb5c49bdd5f02fd3e24e6d9288352aa242525231397345684cefe65d
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.34
|
data/lib/daily_log.rb
CHANGED
|
@@ -62,5 +62,16 @@ module Worklog
|
|
|
62
62
|
def ==(other)
|
|
63
63
|
date == other.date && entries == other.entries
|
|
64
64
|
end
|
|
65
|
+
|
|
66
|
+
# Access a log entry by its unique key.
|
|
67
|
+
# To safeguard against multiple entries with the same key, and future-proofing,
|
|
68
|
+
# an empty string will return nil.
|
|
69
|
+
# @param key [String] the unique key of the log entry
|
|
70
|
+
# @return [LogEntry, nil] the log entry with the specified key, or nil if not found
|
|
71
|
+
def [](key)
|
|
72
|
+
return nil if key.nil? || key.empty?
|
|
73
|
+
|
|
74
|
+
@entries.find { |entry| entry.key == key }
|
|
75
|
+
end
|
|
65
76
|
end
|
|
66
77
|
end
|