sportradar-api 0.10.3 → 0.10.4
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: 2a8e15ec748ae8531d8375862e15a3dcdfa89dc0
|
4
|
+
data.tar.gz: b3ed7c37239710b47f97293e4455278c77a14d7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b308818d367bd5610074774aea38bb3ed00de29f9362cc984f0e81f8f95f8cd90d88a46aeba01136803d05a657add6e4fe3c09d81b63399083543e938d320c
|
7
|
+
data.tar.gz: cb34ebb9d1f6b1f2617a360ec395c43ad1f863dd3353dd85cf76566423a7bf6f2bd6036ecffde465aa84eea29211e37de262e2937307e3ccf657dc1bbfd367cc
|
data/Gemfile.lock
CHANGED
@@ -3,6 +3,8 @@ module Sportradar
|
|
3
3
|
module Basketball
|
4
4
|
class Ncaamb
|
5
5
|
class Team < Sportradar::Api::Basketball::Team
|
6
|
+
attr_accessor :source, :source_id
|
7
|
+
|
6
8
|
@all_hash = {}
|
7
9
|
def self.new(data, **opts)
|
8
10
|
existing = @all_hash[data['id']]
|
@@ -13,7 +15,10 @@ module Sportradar
|
|
13
15
|
if data['id']
|
14
16
|
@all_hash[data['id']] = super
|
15
17
|
else # tournament placeholder
|
16
|
-
super
|
18
|
+
super.tap do |team|
|
19
|
+
team.source = data['source']
|
20
|
+
team.source_id = data.dig('source', 'id')
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -28,7 +28,6 @@ module Sportradar
|
|
28
28
|
@start = Date.parse(data['start_date']) if data['start_date']
|
29
29
|
@end = Date.parse(data['end_date']) if data['end_date']
|
30
30
|
@type = data.dig('season', 'type') if data.dig('season', 'type')
|
31
|
-
@year = @start&.year
|
32
31
|
|
33
32
|
update_rounds(data['rounds']) if data['rounds'] # switch to rounds
|
34
33
|
update_brackets(data['brackets']) if data['brackets'] # switch to brackets
|
@@ -38,6 +37,10 @@ module Sportradar
|
|
38
37
|
rounds.flat_map(&:games)
|
39
38
|
end
|
40
39
|
|
40
|
+
def game(id)
|
41
|
+
games.detect { |g| g.id == id }
|
42
|
+
end
|
43
|
+
|
41
44
|
def year
|
42
45
|
@season&.year || (@start&.-120)&.year
|
43
46
|
end
|
@@ -138,3 +141,15 @@ tt = Sportradar::Api::Basketball::Ncaamb::Tournament.new('id' => "608152a4-cccc-
|
|
138
141
|
t = ss.tournament("1a4a1d3d-b734-4136-a7c2-711b4b3821a5") # => Pac12 tourney 2015
|
139
142
|
t = Sportradar::Api::Basketball::Ncaamb::Tournament.new('id' => "1a4a1d3d-b734-4136-a7c2-711b4b3821a5") # => NCAA tourney 2015
|
140
143
|
t = ts.first
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
sr = Sportradar::Api::Basketball::Ncaamb.new
|
149
|
+
ts = sr.conference_tournaments;
|
150
|
+
asun = "40e97e30-980c-4146-bf69-1791852c5527"
|
151
|
+
t = ts.tournament(asun);
|
152
|
+
t.get_schedule;
|
153
|
+
g = t.game("1fc9ea90-8145-47a6-86a7-9cd05513fb2c")
|
154
|
+
|
155
|
+
|
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.10.
|
4
|
+
version: 0.10.4
|
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-02-
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|