datory 1.0.0.rc17 → 1.0.0.rc18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datory/context/callable.rb +7 -5
- data/lib/datory/version.rb +1 -1
- 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: eb979251a3c5abfb4391233277520df3ae8d03d605cdae59166a80f1c8713b05
|
4
|
+
data.tar.gz: c5fa307e7db176c5f794f1e00da679cbb03463fb4a2ae588a7ae2bdd3b1df418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5e6e7aedec61ea373c9e4df22fe2ded364bc02e9c37b0de0782fdde2e4a52d729b468dd7adfb6252c6b7ea886ffa0d8c3d1ecf37a80620fcff0289676ddc66c
|
7
|
+
data.tar.gz: 7ba8a8b89b44463649617203976bf99000a12d9e9748acc2c1d45f27bf592e6860d1839b5311b5dcae5825c12d008564b9b9eaf5f9ce12f487ff530745c7ccb0
|
@@ -24,15 +24,17 @@ module Datory
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def deserialize(json) # rubocop:disable Metrics/MethodLength
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
# TODO: Need to improve this place by adding more checks and an error exception.
|
28
|
+
parsed_data = json.is_a?(String) ? JSON.parse(json) : json
|
29
|
+
|
30
|
+
if [Set, Array].include?(parsed_data.class)
|
31
|
+
parsed_data.map do |item|
|
32
|
+
deserialize(item)
|
30
33
|
end
|
31
34
|
else
|
32
35
|
context = send(:new)
|
33
|
-
hash = JSON.parse(json.to_json)
|
34
36
|
|
35
|
-
_deserialize(context, **
|
37
|
+
_deserialize(context, **parsed_data)
|
36
38
|
end
|
37
39
|
rescue Datory::Service::Exceptions::Input,
|
38
40
|
Datory::Service::Exceptions::Internal,
|
data/lib/datory/version.rb
CHANGED