sportradar-api 0.13.16 → 0.13.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/sportradar/api/soccer/match.rb +15 -2
- data/lib/sportradar/api/soccer/team.rb +4 -4
- data/lib/sportradar/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15b657c8f1ad8710c0cb6bf38d32671b11a8f81a
|
4
|
+
data.tar.gz: 4550851ad2ae0b79939d83de91a7f37677b9d61c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe5d64ff33024f87dc3606caee80a49ebc8f643d174b15f5c1ce36204dc31ce1252c65fb6def7f47b5b221637d4f344165478c43176288e8e6fc76c8ca65519
|
7
|
+
data.tar.gz: bb3c31e9fee423a17f608dfa963542683e2832a216867f6c08e4dc302952cbe80a9e041b926da5fc7bb8244583f34eac77d705255af07bf43eaa5893bad93ce2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sportradar-api (0.13.
|
4
|
+
sportradar-api (0.13.17)
|
5
5
|
activesupport
|
6
6
|
httparty (>= 0.14.0)
|
7
7
|
|
@@ -86,7 +86,7 @@ GEM
|
|
86
86
|
thor (0.19.4)
|
87
87
|
thread_safe (0.3.6)
|
88
88
|
tins (1.14.0)
|
89
|
-
tzinfo (1.2.
|
89
|
+
tzinfo (1.2.4)
|
90
90
|
thread_safe (~> 0.1)
|
91
91
|
vcr (3.0.3)
|
92
92
|
webmock (3.0.1)
|
@@ -23,8 +23,8 @@ module Sportradar
|
|
23
23
|
@lineups_hash = {}
|
24
24
|
get_tournament_id(data, **opts)
|
25
25
|
@scoring_raw = Scoring.new(data, game: self)
|
26
|
-
@home = Team.new(
|
27
|
-
@away = Team.new(
|
26
|
+
@home = Team.new(data['home'].to_h, api: api, match: self)
|
27
|
+
@away = Team.new(data['away'].to_h, api: api, match: self)
|
28
28
|
@teams_hash = { away: @away, home: @home }
|
29
29
|
@team_ids = { away: @away.id, home: @home.id }
|
30
30
|
@team_stats = {}
|
@@ -226,6 +226,19 @@ module Sportradar
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
+
def timeline_by_minute(minute_start, minute_end = nil)
|
230
|
+
if minute_end
|
231
|
+
@timeline_hash.each_value.select { |ev| (minute_start..minute_end).cover?(ev.match_time.to_i) }
|
232
|
+
else
|
233
|
+
@timeline_hash.each_value.select { |ev| minute_start === ev.match_time }
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
def plays_by_minute(type, minute_start, minute_end = nil)
|
238
|
+
timeline_by_minute(minute_start, minute_end).select { |ev| ev.type == type }
|
239
|
+
end
|
240
|
+
|
241
|
+
|
229
242
|
def lineups(which = nil)
|
230
243
|
if which
|
231
244
|
@lineups_hash[which.to_s]
|
@@ -61,10 +61,10 @@ module Sportradar
|
|
61
61
|
def get_tournament_id(data, **opts)
|
62
62
|
@tournament_id ||= if opts[:tournament]
|
63
63
|
opts[:tournament].id
|
64
|
-
elsif opts[:season]
|
65
|
-
opts[:season]
|
66
|
-
elsif opts[:match]
|
67
|
-
opts[:match]
|
64
|
+
elsif opts[:season]&.tournament_id
|
65
|
+
opts[:season]&.tournament_id
|
66
|
+
elsif opts[:match]&.tournament_id
|
67
|
+
opts[:match]&.tournament_id
|
68
68
|
elsif data['tournament_id']
|
69
69
|
data['tournament_id']
|
70
70
|
elsif data['tournament']
|
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.17
|
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-12-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|