table_transformer 0.0.1 → 0.0.2
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/lib/table_transformer/version.rb +1 -1
- data/lib/table_transformer.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3749b63b879abaf5369c7c9c20715358a01ad17a
|
4
|
+
data.tar.gz: 52bc19a464d192c4684cbe71f37aa00bda0df57a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66fe0d82857433e9e868d145b2997252188bf3a67d11446853c0412a934498b72f3ba0201bccb8d1b3eca95254981589ecc63bd72b203474a9b3ca7aa16a5f1
|
7
|
+
data.tar.gz: 4c871948618d65ad741ca3443cc6526c9b70051f0467c5060d190937dfd6f7fa546108cdae32aadc6b2e973cce6b82bbb4d7cec192b53237629ea8892573e018
|
data/lib/table_transformer.rb
CHANGED
@@ -49,7 +49,7 @@ module TableTransformer
|
|
49
49
|
original.each do |data|
|
50
50
|
transformed_data = {}.tap do |t_data|
|
51
51
|
keys.each do |k|
|
52
|
-
t_data[k] = data[k].to_s
|
52
|
+
t_data[k] = data[k].to_s
|
53
53
|
end
|
54
54
|
break t_data
|
55
55
|
end
|
@@ -77,7 +77,7 @@ module TableTransformer
|
|
77
77
|
def max_size
|
78
78
|
@max_size ||= {}.tap do |size|
|
79
79
|
keys.each do |k|
|
80
|
-
max_data = string_data.max_by { |data| data[k].size }
|
80
|
+
max_data = string_data.max_by { |data| data[k].to_s.size }
|
81
81
|
size[k] = max_data[k].to_s.size
|
82
82
|
end
|
83
83
|
break size
|