sportradar-api 0.13.7 → 0.13.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 261614c3df25512fb2357a7db35385ac28504b6c
|
4
|
+
data.tar.gz: d24b315ce19e902c9202fbd76a19c251272ce1d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e278b2c57ee6c770fe6e761575dd0512bf8bd188bf198f2aba6bbaa8405ed58ee1a8899808e0ef4254a6fb48d06603b57b3bcfb8d6ae59eae6f1f6633be37f
|
7
|
+
data.tar.gz: e87a20f5c1446db67e8b81db3753c384b3d7e435af9826b6c24c0721414f600be43c437730b67b3db0e077cbbe884a426016c1b995c7f153090ddf0defa66e6d
|
data/Gemfile.lock
CHANGED
@@ -10,6 +10,8 @@ module Sportradar
|
|
10
10
|
@response = data
|
11
11
|
@id = data['id'] if data['id']
|
12
12
|
@api = opts[:api]
|
13
|
+
@team = opts[:team]
|
14
|
+
|
13
15
|
@league_group = league_group || data['league_group'] || @api&.league_group
|
14
16
|
|
15
17
|
update(data, **opts)
|
@@ -36,6 +38,9 @@ module Sportradar
|
|
36
38
|
@matches_played = data['matches_played'] if data['matches_played']
|
37
39
|
@stats = data['statistics'] if data['statistics']
|
38
40
|
@date_of_birth = Date.parse(data['date_of_birth']) if data['date_of_birth']
|
41
|
+
|
42
|
+
@team.update_player_stats(self, data['statistics'], opts[:game]) if data['statistics'] && @team
|
43
|
+
|
39
44
|
end
|
40
45
|
|
41
46
|
def display_name
|
@@ -2,13 +2,13 @@ module Sportradar
|
|
2
2
|
module Api
|
3
3
|
module Soccer
|
4
4
|
class Team < Data
|
5
|
-
attr_accessor :tournament_id, :venue
|
5
|
+
attr_accessor :tournament_id, :venue, :player_stats
|
6
6
|
attr_reader :id, :league_group, :name, :country, :country_code, :abbreviation, :qualifier
|
7
7
|
alias :alias :abbreviation
|
8
8
|
alias :market :name
|
9
9
|
alias :display_name :name
|
10
10
|
alias :full_name :name
|
11
|
-
attr_reader :
|
11
|
+
attr_reader :team_stats, :jerseys, :manager, :statistics
|
12
12
|
|
13
13
|
def initialize(data = {}, league_group: nil, **opts)
|
14
14
|
@response = data
|
@@ -17,6 +17,7 @@ module Sportradar
|
|
17
17
|
@league_group = league_group || data['league_group'] || @api&.league_group
|
18
18
|
|
19
19
|
@players_hash = {}
|
20
|
+
@player_stats = {}
|
20
21
|
@matches_hash = {}
|
21
22
|
|
22
23
|
update(data, **opts)
|
@@ -42,7 +43,7 @@ module Sportradar
|
|
42
43
|
create_data(@players_hash, data['player_statistics'], klass: Player, api: api, team: self) if data['player_statistics']
|
43
44
|
|
44
45
|
# TODO team statistics
|
45
|
-
@
|
46
|
+
@team_stats = data['team_statistics'] if data['team_statistics']
|
46
47
|
|
47
48
|
create_data(@matches_hash, Soccer.parse_results(data['results']), klass: Match, api: api, team: self) if data['results']
|
48
49
|
create_data(@matches_hash, data['schedule'], klass: Match, api: api, team: self) if data['schedule']
|
@@ -100,7 +101,9 @@ module Sportradar
|
|
100
101
|
url, headers, options, timeout = api.get_request_info(path_roster)
|
101
102
|
{url: url, headers: headers, params: options, timeout: timeout, callback: method(:ingest_roster)}
|
102
103
|
end
|
103
|
-
|
104
|
+
def update_player_stats(player, stats, game = nil)
|
105
|
+
game ? game.update_player_stats(player, stats) : @player_stats.merge(player.id => stats.merge(player: player))
|
106
|
+
end
|
104
107
|
def path_results
|
105
108
|
"#{ path_base }/results"
|
106
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportradar-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|