wargaming_api_ruby 0.1.0 → 0.1.1
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/wargaming_api/node.rb +2 -4
- data/lib/wargaming_api/version.rb +1 -1
- 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: 70a0cdc14720f038e28c1cc143f678c9fdc2d05d
|
4
|
+
data.tar.gz: 0aa989989d5ceed6b562c0f3dc6532ad241d39cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a9b3c4cfa23e4769147934437ccfca6d6c56e392d2a716c0b9026e898a4fcda29f83e2fc775e164ca13f3a243589f7bc2d06dd032345978d138aadab0d2cd4d
|
7
|
+
data.tar.gz: ab5c7c6ac5c561f970bf2854d7ff9d29edaffa3d2809b603d274347b58c616116a7c0d5d106cfeabe98e29c736d0087083309b27744aa2b57ef54e751e17adc7
|
data/lib/wargaming_api/node.rb
CHANGED
@@ -40,9 +40,7 @@ class WargamingApi::Node
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def initialize_as_hash(hash)
|
43
|
-
if hash.keys.any? { |key| key =~ /[A-Z\d]+/ && hash[key].is_a?(Hash) }
|
44
|
-
initialize_as_array(hash.values)
|
45
|
-
elsif hash.keys.any? { |key| key =~ /[A-Z\d]+/ && hash[key].is_a?(Array) }
|
43
|
+
if hash.keys.any? { |key| key =~ /[A-Z\d]+/ && (hash[key].is_a?(Hash) || hash[key].is_a?(Array) || hash[key].is_a?(NilClass)) }
|
46
44
|
initialize_as_array(hash.values)
|
47
45
|
else
|
48
46
|
initialize_attributes(hash)
|
@@ -50,7 +48,7 @@ class WargamingApi::Node
|
|
50
48
|
end
|
51
49
|
|
52
50
|
def define_array(array)
|
53
|
-
array.map { |hash| WargamingApi::Node.new(hash) }
|
51
|
+
array.map { |hash| hash ? WargamingApi::Node.new(hash) : nil }
|
54
52
|
end
|
55
53
|
|
56
54
|
def initialize_attributes(hash)
|