sportradar-api 0.11.34 → 0.11.35
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: 66e0d9dfe29c0eaabddc956f1de904d51c1addbe
|
4
|
+
data.tar.gz: 33d40a64e3bd1e6cb302baa29b326def1eb6bdcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1362b108d7a47ba6542955157903d444a05cd891c4d899fe0f795d515fb7d8c1803018c96a1754395a29352f8aae092e90415ca6b7251da2de38319c3b6212d
|
7
|
+
data.tar.gz: 9d06816e9535be9678296110080ab5de723e3114eac0314db22c96fc2e7169c5cef0d116833a0bd68d7344c16003c0fde78d5d74caf1d8cb808bb6df7945ff3b
|
data/Gemfile.lock
CHANGED
@@ -25,9 +25,9 @@ module Sportradar
|
|
25
25
|
|
26
26
|
def get_details
|
27
27
|
if @details
|
28
|
-
|
29
|
-
update(
|
30
|
-
|
28
|
+
@detailed_data = @api.get_data(@details).to_h
|
29
|
+
update(@detailed_data)
|
30
|
+
@detailed_data
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -64,7 +64,7 @@ module Sportradar
|
|
64
64
|
when /intercepted/i
|
65
65
|
:interception
|
66
66
|
when /fumbles/i
|
67
|
-
:fumble
|
67
|
+
self.statistics&.fumble&.first&.lost? && :fumble
|
68
68
|
when /extra point is good/i
|
69
69
|
:touchdown
|
70
70
|
# when missed extra point
|
@@ -2,16 +2,18 @@ module Sportradar
|
|
2
2
|
module Api
|
3
3
|
module Football
|
4
4
|
class PlayStatistics < Data
|
5
|
-
attr_accessor :response, :kick, :return, :rush, :defense, :receive, :punt, :penalty, :pass, :first_down, :field_goal, :extra_point, :defense, :down_conversion
|
5
|
+
attr_accessor :response, :kick, :return, :rush, :defense, :receive, :punt, :penalty, :pass, :first_down, :field_goal, :extra_point, :defense, :down_conversion, :fumble
|
6
6
|
def initialize(data)
|
7
7
|
data = [data] if data.is_a?(Hash)
|
8
8
|
@response = data
|
9
9
|
if data.first['name'] # indicates college data structures. we want to convert it to nfl data structures
|
10
|
-
data.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
data = data.flat_map do |hash|
|
11
|
+
types = self.class.college_type_translations.each_key.select { |str| hash.key?(str) }
|
12
|
+
types.map do |type|
|
13
|
+
stats = hash.delete(type)
|
14
|
+
new_team = { 'id' => hash['team'], 'alias' => hash['team'] } # use intermediate variable to avoid temp memory blowup
|
15
|
+
{ 'player' => hash, 'team' => new_team, 'stat_type' => self.class.college_type_translations[type] }.merge(stats)
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
data.each do |hash|
|
@@ -280,6 +282,8 @@ module Sportradar
|
|
280
282
|
attr_reader :own_rec, :own_rec_yards, :forced, :team, :player
|
281
283
|
def initialize(data)
|
282
284
|
@response = data
|
285
|
+
@oob = data['oob']
|
286
|
+
@lost = data['lost']
|
283
287
|
@own_rec = data['own_rec']
|
284
288
|
@own_rec_yards = data['own_rec_yards']
|
285
289
|
@forced = data['forced']
|
@@ -287,6 +291,9 @@ module Sportradar
|
|
287
291
|
@team = OpenStruct.new(data['team']) if data['team']
|
288
292
|
@player = OpenStruct.new(data['player']) if data['player']
|
289
293
|
end
|
294
|
+
def lost?
|
295
|
+
@lost == 1 || @own_rec == 0
|
296
|
+
end
|
290
297
|
end
|
291
298
|
|
292
299
|
class PlayRushStatistics < Data
|