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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 612384e027eaf4f9704fb62f14e806016a7eaa47
4
- data.tar.gz: 136f2d0c3722c84c085a12856ca42b66b9a66d7c
3
+ metadata.gz: 70a0cdc14720f038e28c1cc143f678c9fdc2d05d
4
+ data.tar.gz: 0aa989989d5ceed6b562c0f3dc6532ad241d39cc
5
5
  SHA512:
6
- metadata.gz: 807f00298eac4f233a2e9b4fe1873e832df334dcf2a5f82d25782bb81ed227a77668890314b42be03e82280698e0f4437980eead8c6ca541e9cdb91363f65d6e
7
- data.tar.gz: 74b96b0048897103e69a4750e8a34a1e0db7643d3d215b1e3881aa938e287e41f6ea8d4e12705d5cc54ff492070c54aa4ee982dd338b03335989d1d8a79989c4
6
+ metadata.gz: 7a9b3c4cfa23e4769147934437ccfca6d6c56e392d2a716c0b9026e898a4fcda29f83e2fc775e164ca13f3a243589f7bc2d06dd032345978d138aadab0d2cd4d
7
+ data.tar.gz: ab5c7c6ac5c561f970bf2854d7ff9d29edaffa3d2809b603d274347b58c616116a7c0d5d106cfeabe98e29c736d0087083309b27744aa2b57ef54e751e17adc7
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module WargamingApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wargaming_api_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Drobotov