sportradar-api 0.10.9 → 0.10.10

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
  SHA1:
3
- metadata.gz: 4ae1848bcb7fd5856ebcda901357e2a7f250bdb9
4
- data.tar.gz: 2884bde1ef85159f0c7a56516476deb420b175ae
3
+ metadata.gz: cfd75ac6934458b86512e7a28b0f9ea7e3bc618c
4
+ data.tar.gz: 215d4fe046b98f1759acd51829cc503f95092820
5
5
  SHA512:
6
- metadata.gz: 50973e42f43240614f1f1dfbb0f0f1a7b9a9c1792c725c227c7cec665c887b7470bd5776bd4ca6c6beac8e1f9304798f4049999280c0cf306db562759acb6c93
7
- data.tar.gz: a94ccde0f994949dd10839cc297aee508981d6a654d57f56097d389f12735e3d711dba5813718bcdb7ee4daeadc962e12259561fd113b8d5c0784210ab45d066
6
+ metadata.gz: 208754668c5cf7d026b6fcea76f829f796f1d8c8d1ee67043d61d7cfa35f95b811f13195da3523d365a61aef7ca4df871b03defd81ced1e61e201f090aa51134
7
+ data.tar.gz: 6eae6ab308ba6999b3867546bdf33ec638e10ff23fa31608e94a0a038ca0a8ec7bb23e2bfcf5baef2e7b08715ed84fa215e5fff889945b7f17ad5afb6d5dd1b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.10.9)
4
+ sportradar-api (0.10.10)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -24,8 +24,8 @@ module Sportradar
24
24
  @start_date = data['start_date'] if data['start_date']
25
25
 
26
26
 
27
- update_games(data['games']) if data['games']
28
27
  update_participants(data['participants']) if data['participants']
28
+ update_games(data['games']) if data['games']
29
29
  end
30
30
 
31
31
  def games
@@ -3,6 +3,8 @@ module Sportradar
3
3
  module Basketball
4
4
  class Nba
5
5
  class Team < Sportradar::Api::Basketball::Team
6
+
7
+
6
8
  @all_hash = {}
7
9
  def self.new(data, **opts)
8
10
  existing = @all_hash[data['id']]
@@ -10,6 +12,9 @@ module Sportradar
10
12
  existing.update(data, **opts)
11
13
  existing
12
14
  else
15
+ unless data['id']
16
+ data.merge!(data.delete('team')) if data['team']
17
+ end
13
18
  @all_hash[data['id']] = super
14
19
  end
15
20
  end
@@ -56,8 +56,13 @@ module Sportradar
56
56
  when Array
57
57
  data.each do |hash|
58
58
  current = existing[hash['id']]
59
- current ? current.update(hash, **opts) : existing[hash['id']] = klass.new(hash, **opts)
60
- existing[hash['id']]
59
+ if current
60
+ current.update(hash, **opts)
61
+ else
62
+ current = klass.new(hash, **opts)
63
+ existing[current.id] = current
64
+ end
65
+ existing[current.id]
61
66
  end
62
67
  when Hash
63
68
  existing[data['id']] = klass.new(data, **opts)
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.10.9"
3
+ VERSION = "0.10.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.9
4
+ version: 0.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett