seri 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serializer/version.rb +1 -1
- data/lib/serializer.rb +3 -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: 3a080e5eb873ba467789a339f0ceefa26e8f86b9c88f92d11f55b97a5bba86d0
|
4
|
+
data.tar.gz: 30b4ef48887b9a4083c64623f46294079078add3176ef45ee92a9dfbe98e4f66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e8fe5badf7bfc337d91e02540a1df44f66de49786e9b8c1da6cfd59b631f613bdf9e3aba61ad972d366716dfe32c21b527bc4b67373d3cd59a61e672952e226
|
7
|
+
data.tar.gz: 65d6c70dfea3489728816beffd1c4febbabf2076607f06daa55991a4f1ac9cfbd5526ac6fab32bd2b78d5a89f534b9e844f8e3a53f2f69a6692fa3ebf95b106e
|
data/lib/serializer/version.rb
CHANGED
data/lib/serializer.rb
CHANGED
@@ -42,18 +42,14 @@ class Serializer
|
|
42
42
|
value = if attribute.options.has_key?(:static_value)
|
43
43
|
attribute.options.fetch(:static_value)
|
44
44
|
elsif respond_to?(extraction_key)
|
45
|
-
|
46
|
-
|
47
|
-
serialize_value(value, attribute.serializer)
|
45
|
+
public_send(extraction_key)
|
48
46
|
elsif object.respond_to?(extraction_key)
|
49
|
-
|
50
|
-
|
51
|
-
serialize_value(value, attribute.serializer)
|
47
|
+
object.public_send(extraction_key)
|
52
48
|
else
|
53
49
|
raise SerializerError, "unknown attribute '#{extraction_key}'"
|
54
50
|
end
|
55
51
|
|
56
|
-
obj[attribute.key] = value
|
52
|
+
obj[attribute.key] = serialize_value(value, attribute.serializer)
|
57
53
|
end
|
58
54
|
end
|
59
55
|
|