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: 6a68cc5b4df91daab8a7efea62107d96814d39b8
4
- data.tar.gz: e9762555eebc08323a538a27d062d255ca42c7ae
3
+ metadata.gz: 2a8e15ec748ae8531d8375862e15a3dcdfa89dc0
4
+ data.tar.gz: b3ed7c37239710b47f97293e4455278c77a14d7f
5
5
  SHA512:
6
- metadata.gz: 8a03c8b61986db9e6fe0a088a373de7c1329f02319e8d116c583d4a2fc12a7b0c9697839ca843c2c18bc2190dd4510525e0062ce1fad4f008fb928ca972a466b
7
- data.tar.gz: '0984fb7ec961a985b744a1cdcae266f25211a9e0dfd3adc1f84bf060ab67aed8ef65969193d03d340a885055b8421725378b686d81607b848432e8333ebed901'
6
+ metadata.gz: 11b308818d367bd5610074774aea38bb3ed00de29f9362cc984f0e81f8f95f8cd90d88a46aeba01136803d05a657add6e4fe3c09d81b63399083543e938d320c
7
+ data.tar.gz: cb34ebb9d1f6b1f2617a360ec395c43ad1f863dd3353dd85cf76566423a7bf6f2bd6036ecffde465aa84eea29211e37de262e2937307e3ccf657dc1bbfd367cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.10.3)
4
+ sportradar-api (0.10.4)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -3,7 +3,7 @@ module Sportradar
3
3
  module Basketball
4
4
  class Ncaamb
5
5
  class Round < Data
6
- attr_accessor :response, :id, :name, :location, :start, :end
6
+ attr_accessor :response, :id, :name, :location, :start, :end, :sequence
7
7
 
8
8
  def initialize(data, **opts)
9
9
  @response = data
@@ -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
+
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.10.3"
3
+ VERSION = "0.10.4"
4
4
  end
5
5
  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.10.3
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-23 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler