sportradar-api 0.15.1 → 0.16.0

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
  SHA256:
3
- metadata.gz: bba48f7a53c730efd0ffbac0aa866d7c9bb75fa85820eed305187873f9e1f829
4
- data.tar.gz: 7bdd775b59d4515b5b74db3abf78208d9b770ed2453533b3713c62c3918e8d2a
3
+ metadata.gz: 728ba648950b8cab5dee8e41e1e69ac24147bee213382aa0f5b8554430918d85
4
+ data.tar.gz: 38d070d071f227dcbbee7813fd737800ba551662247cdfd0683eacbfad9bddd3
5
5
  SHA512:
6
- metadata.gz: 305cd635d3b18cb463d30575476ce864cf70ad51532a52b756d20af6a2402fff742f1916f7b7aca482835c23fc108b1095dea576363e0a6aba6d2176ad326b05
7
- data.tar.gz: 57cfc2fc2ed2681486d7c16ac71bfa3b434dc039dd80dab742dd972dc92c8c66e268b553504840baa70c258d4e5bf83f6477b714dada93ffce5677f2c5328f65
6
+ metadata.gz: 0f51fe2a602f27a84639b040fb9220dc7fdb62c4cff598b7daee2f62f5124e94f2e3f28c7e34456a4c0bc9fccd8644289f791817c8c6fb60a8f09a4543921b9d
7
+ data.tar.gz: 829d946e8e842d61b4842201327657b67400c60f6ffc95308c2fc2a46c68f0186fde2bc006aca677631356f3e7bb8a48705de8ac0720d902a53a34644d1b5bd7
@@ -43,6 +43,10 @@ module Sportradar
43
43
  {}
44
44
  end
45
45
 
46
+ def period
47
+ @innings
48
+ end
49
+
46
50
  def tied?
47
51
  @score[away_id].to_i == @score[home_id].to_i
48
52
  end
@@ -350,6 +354,10 @@ module Sportradar
350
354
  }.freeze[self.count['inning_half']]
351
355
  end
352
356
 
357
+ def clock
358
+ half_short
359
+ end
360
+
353
361
  def postponed?
354
362
  'postponed' == status
355
363
  end
@@ -27,9 +27,9 @@ module Sportradar
27
27
  end
28
28
  def default_access_level
29
29
  if (ENV['SPORTRADAR_ENV_MLB'] || ENV['SPORTRADAR_ENV'] || ENV['RACK_ENV'] || ENV['RAILS_ENV']) == 'production'
30
- 'p'
30
+ 'production'
31
31
  else
32
- 't'
32
+ 'trial'
33
33
  end
34
34
  end
35
35
 
@@ -40,11 +40,11 @@ module Sportradar
40
40
  private
41
41
 
42
42
  def request_url(path)
43
- "/mlb-#{access_level}#{version}/#{path}"
43
+ "/mlb/#{access_level}/v#{version}/en/#{path}"
44
44
  end
45
45
 
46
46
  def api_key
47
- if !['t', 'sim'].include?(access_level)
47
+ if !['trial', 'sim'].include?(access_level)
48
48
  Sportradar::Api.api_key_params('mlb', 'production')
49
49
  elsif 'sim' == access_level
50
50
  Sportradar::Api.api_key_params('mlb', 'simulation')
@@ -58,7 +58,7 @@ module Sportradar
58
58
  end
59
59
 
60
60
  def allowed_access_levels
61
- %w[p t sim]
61
+ %w[production trial sim]
62
62
  end
63
63
 
64
64
  def allowed_seasons
@@ -128,7 +128,7 @@ module Sportradar
128
128
  "teams/#{ id }"
129
129
  end
130
130
  def path_base_stats(season_year = api.default_year, default_season = api.default_season)
131
- "seasontd/#{season_year}/#{default_season}/teams/#{id}"
131
+ "seasons/#{season_year}/#{default_season}/teams/#{id}"
132
132
  end
133
133
  def path_roster
134
134
  "#{ path_base }/profile"
@@ -2,7 +2,7 @@ module Sportradar
2
2
  module Api
3
3
  module Basketball
4
4
  class Game < Data
5
- attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :scheduled, :venue, :broadcast, :clock, :duration, :attendance, :team_stats, :player_stats, :changes, :media_timeouts
5
+ attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :time_zone, :scheduled, :venue, :broadcast, :clock, :duration, :attendance, :team_stats, :player_stats, :changes, :media_timeouts
6
6
 
7
7
  attr_accessor :period
8
8
  @all_hash = {}
@@ -94,6 +94,7 @@ module Sportradar
94
94
  @away = team_class.new(data['away'], api: api, game: self) if data['away']
95
95
  @title = data['title'] || @title || (home && away && "#{home.full_name} vs #{away.full_name}")
96
96
 
97
+ @time_zone = data.dig("time_zones", "venue") if data.dig("time_zones", "venue")
97
98
  @duration = data['duration'] if data['duration']
98
99
  @clock = data['clock'] if data['clock']
99
100
  @attendance = data['attendance'] if data['attendance']
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.15.1"
3
+ VERSION = "0.16.0"
4
4
  end
5
5
  end
@@ -51,7 +51,7 @@ module Sportradar
51
51
 
52
52
  API_GALLERY = [
53
53
  {api: :nfl, version: 1},
54
- {api: :mlb, version: 6},
54
+ {api: :mlb, version: 7},
55
55
  {api: :nhl, version: 3},
56
56
  {api: :nba, version: 7},
57
57
  {api: :ncaamb, version: 3},
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.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler