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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff1061ed5efc8ae9bb2b2869d8c745de7576adbb85758c1ed0655f6159e0e191
4
- data.tar.gz: e0040ac246130dd097433a3f472b94dcf6022ce334ba8213af31336d87fdbcd7
3
+ metadata.gz: eb979251a3c5abfb4391233277520df3ae8d03d605cdae59166a80f1c8713b05
4
+ data.tar.gz: c5fa307e7db176c5f794f1e00da679cbb03463fb4a2ae588a7ae2bdd3b1df418
5
5
  SHA512:
6
- metadata.gz: b38dbd31412aa31012c51b6e9fda0efa2a5bbabb946904491670127c69965d20c8e6e962c8666259e64a25a47bf89e3464d457600dfa7bbff152bf6b237e5b18
7
- data.tar.gz: 50310262dfe8d781cb869091fdcbadac1da85a8c3769b1988f8465786919861fe151ecc6299667b19ae7733cd269ab61d89831ef19c38dfe40fb2bbf141628b1
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
- if [Set, Array].include?(json.class)
28
- json.map do |json_item|
29
- deserialize(json_item)
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, **hash)
37
+ _deserialize(context, **parsed_data)
36
38
  end
37
39
  rescue Datory::Service::Exceptions::Input,
38
40
  Datory::Service::Exceptions::Internal,
@@ -5,7 +5,7 @@ module Datory
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
7
  PATCH = 0
8
- PRE = "rc17"
8
+ PRE = "rc18"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc17
4
+ version: 1.0.0.rc18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov