seri 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/serializer/version.rb +1 -1
- data/lib/serializer.rb +5 -7
- 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: 5adc32c82dea64e690e2a39b2b2dd1cbfc5bcd8816a8d34d271cd14d71edfd95
|
4
|
+
data.tar.gz: 5415cb4b3ac84b365ad4dd34bb81dc3d3edc9d12697556b31078d74bc4a574c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 567a40baa057f07add6ad38aedaf6f04303e93a67d41e056a30f25adbd2ccb3580af5270f5ae15c6daf7db805f383aef191b1bd2754150f43965206073e688cc
|
7
|
+
data.tar.gz: aa5d0a9a533845d21dd9fc9a9e7538eed5bc88bbb06b361cb0ce6454f9ce32f14a990e2b9e8425061068a0970d049529d5dcddea3118a2759f66ac1d5afe17fd
|
data/Gemfile.lock
CHANGED
data/lib/serializer/version.rb
CHANGED
data/lib/serializer.rb
CHANGED
@@ -48,14 +48,12 @@ class Serializer
|
|
48
48
|
value = extract_value(attribute)
|
49
49
|
serializer = attribute.serializer
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
serializer.new(value).to_h
|
56
|
-
end
|
51
|
+
return value unless serializer
|
52
|
+
|
53
|
+
if ARRAYS.any? { |match| value.class.to_s.end_with?(match) }
|
54
|
+
value.map { |v| serializer.new(v).to_h }
|
57
55
|
else
|
58
|
-
value
|
56
|
+
serializer.new(value).to_h
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|