fewald-worklog 0.3.16 → 0.3.17
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/hash.rb +5 -5
- 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: daf7ba6ce29841da81257ab2588d1a0a8c5e8d676ddc1e2e128193800c0c99bd
|
|
4
|
+
data.tar.gz: 6be278d7cee0950a81547ed66f4e3705fae8996295c6bf6fff4ad49e2301bc7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57dff043170f5d3bf474367a7589350d76d132140a3e3a97335d01547442401f9151b67ec21eaedf0d283f89a25184fe4e045e7c793f66043961cf41806a5379
|
|
7
|
+
data.tar.gz: 012ba10f1d2b98e429ccf0e8ac500022ccb10bb1b9ec75070679e91edade978539b724c855a88e339248718567e8faa89d6ac6f8adbbf008c393841672b561a9
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.17
|
data/lib/hash.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Hashify
|
|
4
|
+
# Convert the object's instance variables to a hash.
|
|
5
|
+
# @return [Hash] the hash representation of the object
|
|
4
6
|
def to_hash
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
hash[var.to_s.delete('@')] = value
|
|
7
|
+
instance_variables.each_with_object({}) do |var, hash|
|
|
8
|
+
key = var.to_s.delete('@').to_sym
|
|
9
|
+
hash[key] = instance_variable_get(var)
|
|
9
10
|
end
|
|
10
|
-
hash
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|