sportradar-api 0.13.5 → 0.13.6
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: 74474a87a87f1d7c24470c35baf316ebe4298c12
|
4
|
+
data.tar.gz: 2521a474e47fe6301ee640af81cfcef6cebe6085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3931981312ecac90dacac1c8efba50664c850dbde5c5eda2ad5002b281e90b3f23233d99c03daf4ce3ccd328bf35125913813a530f960e06242299f7839a3899
|
7
|
+
data.tar.gz: dad54c364a8a4776b53651d5c28c0aeeb2b5358e62c3c57be260c7b625dbc6cbc95bb8a771a701ed9b7b68d581dc62a6962502183fc8fe0c7c35a6cc1f4fea5f
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ module Sportradar
|
|
3
3
|
module Basketball
|
4
4
|
class Play
|
5
5
|
class Base < Data
|
6
|
-
attr_accessor :response, :id, :clock, :event_type, :description, :statistics, :score, :team_id, :player_id, :quarter, :half, :updated, :location, :possession, :on_court, :game_seconds, :identifier
|
6
|
+
attr_accessor :response, :id, :clock, :event_type, :description, :statistics, :score, :team_id, :player_id, :quarter, :half, :updated, :location, :possession, :on_court, :on_court_ids, :game_seconds, :identifier
|
7
7
|
alias :type :event_type
|
8
8
|
|
9
9
|
def initialize(data, **opts)
|
@@ -87,11 +87,18 @@ module Sportradar
|
|
87
87
|
@location = data['location'] # {"coord_x"=>"0", "coord_y"=>"0"},
|
88
88
|
@possession = data['possession'] # {"name"=>"Knicks", "market"=>"New York", "id"=>"583ec70e-fb46-11e1-82cb-f4ce4684ea4c"},
|
89
89
|
# @on_court = data['on_court'] # hash
|
90
|
+
handle_on_court(data['on_court']) if data['on_court']
|
90
91
|
|
91
92
|
handle_time(data, **opts)
|
92
93
|
parse_statistics(data) if data['statistics']
|
93
94
|
end
|
94
95
|
|
96
|
+
def handle_on_court(data)
|
97
|
+
teams = [data['home'], data['away']]
|
98
|
+
@on_court = teams.flat_map { |hash| hash['players'].map { |pl| OpenStruct.new(pl) } }
|
99
|
+
@on_court_ids = @on_court.map(&:id)
|
100
|
+
end
|
101
|
+
|
95
102
|
def handle_time(data, **opts)
|
96
103
|
@game_seconds = if opts[:quarter]
|
97
104
|
@quarter = opts[:quarter].sequence.to_i rescue opts[:quarter].to_i
|
@@ -34,9 +34,7 @@ module Sportradar
|
|
34
34
|
@jersey_number = data['jersey_number'] if data['jersey_number']
|
35
35
|
@preferred_foot = data['preferred_foot'] if data['preferred_foot']
|
36
36
|
@matches_played = data['matches_played'] if data['matches_played']
|
37
|
-
|
38
37
|
@stats = data['statistics'] if data['statistics']
|
39
|
-
|
40
38
|
@date_of_birth = Date.parse(data['date_of_birth']) if data['date_of_birth']
|
41
39
|
end
|
42
40
|
|
@@ -45,11 +43,11 @@ module Sportradar
|
|
45
43
|
end
|
46
44
|
|
47
45
|
def first_name
|
48
|
-
@
|
46
|
+
@name.split()[1]
|
49
47
|
end
|
50
48
|
|
51
49
|
def last_name
|
52
|
-
@
|
50
|
+
@name.split()[0].delete(',')
|
53
51
|
end
|
54
52
|
|
55
53
|
def api
|
@@ -235,6 +235,7 @@ module Sportradar
|
|
235
235
|
'eu.uefa_champions_league' => "sr:tournament:7",
|
236
236
|
'eu.la_liga' => "sr:tournament:8",
|
237
237
|
'eu.eng_premier_league' => "sr:tournament:17",
|
238
|
+
'eu.premier_league' => "sr:tournament:17",
|
238
239
|
'eu.serie_a' => "sr:tournament:23",
|
239
240
|
'eu.ligue_1' => "sr:tournament:34",
|
240
241
|
'eu.bundesliga' => "sr:tournament:35",
|
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.6
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|