sportradar 0.0.21 → 0.0.22

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: 34c78d2139bbf5328c9563b9ce9615b8b00f879d
4
- data.tar.gz: 2467c608daafb69d0bf8b3de88c6b5d7d51d654d
3
+ metadata.gz: 32df57529ba6bb275ab632929a90fa6c630e1fff
4
+ data.tar.gz: 648d7a5ddd5d6d83b2ffb87d00cf13d064c19b4d
5
5
  SHA512:
6
- metadata.gz: df19c6085867607aec175ab611b742f62c6e21dc94d1b9111143e4b485726b3108fad0f77072c1272a062bc0884f6e912941a5e4129701d3cb53c2e2f9151ea8
7
- data.tar.gz: ebf03c3b64adb4ac2b97e160e5376f57cb8379a4362cc2b4ed9f525b22434a0fd86fb41d6c5169abf5f03ddc660fc272d3309407cdd227f972c92d70f61c36d6
6
+ metadata.gz: 895cc3cebbac0c282b7ff14789273a75c64e99a2ecf3985c39b782d9e950060000550dc6125078892d3e0180d8655a8110a26514286392a8f53839967f14a5b6
7
+ data.tar.gz: a2bc233dfe5c303094d47fde61635769298c8d8fc9d5178a617f9392f4302c2feebdb7165d75cde5b62f4703a4d020c1e057369c5bf21a70f401f953396edc02
data/README.md CHANGED
@@ -14,7 +14,7 @@ Currently supports
14
14
  Add this line to your application's Gemfile:
15
15
 
16
16
  ```ruby
17
- gem 'sportradar', '>= 0.0.21'
17
+ gem 'sportradar', '>= 0.0.22'
18
18
  ```
19
19
 
20
20
  And then execute:
@@ -34,24 +34,26 @@ In your `.env`:
34
34
  ```
35
35
  SPORTRADAR_ACCESS_LEVEL_MLB=t
36
36
  SPORTRADAR_API_KEY_MLB=YOUR_API_KEY
37
+ SPORTRADAR_API_VERSION_MLB=5
37
38
 
38
39
  SPORTRADAR_ACCESS_LEVEL_NBA=t
39
40
  SPORTRADAR_API_KEY_NBA=YOUR_API_KEY
41
+ SPORTRADAR_API_VERSION_NBA=3
40
42
 
41
43
  SPORTRADAR_ACCESS_LEVEL_NFL=t
42
44
  SPORTRADAR_API_KEY_NFL=YOUR_API_KEY
45
+ SPORTRADAR_API_VERSION_NFL=1
43
46
 
44
47
  SPORTRADAR_ACCESS_LEVEL_NHL=t
45
48
  SPORTRADAR_API_KEY_NHL=YOUR_API_KEY
49
+ SPORTRADAR_API_VERSION_NHL=4
46
50
 
47
51
  SPORTRADAR_FILE_PATH=/path/to/save/responses
48
52
  ```
49
53
 
50
- `SPORTRADAR_ACCESS_LEVEL` is `t` or 'p' (or 'rt')
54
+ `SPORTRADAR_ACCESS_LEVEL` is `t`,'p', or 'o' (or 'rt' or 'ot')
51
55
 
52
- Note: Currently only MLB and NFL support.
53
-
54
- Important: This is a breaking change from version 0.0.3 that had a global access level.
56
+ Important: Version 0.0.22 allows you to set both the access level and api version per league.
55
57
 
56
58
  ### Console
57
59
 
@@ -206,7 +208,7 @@ Some helpers will call `.save` for each response as separate items.
206
208
 
207
209
  ### Hockey/NHL
208
210
 
209
- Defaults to and supports NHL Classic API feed version 3 only (not Official).
211
+ Defaults to and supports NHL API feed version 4 only.
210
212
 
211
213
  Models and parsers can get plays, scoring plays, players on court, stoppages from NHL Play by Play json data.
212
214
 
@@ -93,18 +93,9 @@ module Sportradar
93
93
  end
94
94
 
95
95
  def api_version
96
- case league
97
- when 'mlb'
98
- '5'
99
- when 'nba'
100
- '3'
101
- when 'nfl'
102
- '1'
103
- when 'nhl'
104
- '3'
105
- else
106
- '5'
107
- end
96
+ Sportradar.configuration.
97
+ api_version[league].
98
+ freeze
108
99
  end
109
100
 
110
101
  private
@@ -33,10 +33,19 @@ module Sportradar
33
33
 
34
34
  def access_levels
35
35
  {
36
- 'mlb' => ENV['SPORTRADAR_ACCESS_LEVEL_MLB'],
37
- 'nba' => ENV['SPORTRADAR_ACCESS_LEVEL_NBA'],
38
- 'nfl' => ENV['SPORTRADAR_ACCESS_LEVEL_NFL'],
39
- 'nhl' => ENV['SPORTRADAR_ACCESS_LEVEL_NHL'],
36
+ 'mlb' => ENV['SPORTRADAR_ACCESS_LEVEL_MLB'] || 'p',
37
+ 'nba' => ENV['SPORTRADAR_ACCESS_LEVEL_NBA'] || 'p',
38
+ 'nfl' => ENV['SPORTRADAR_ACCESS_LEVEL_NFL'] || 'p',
39
+ 'nhl' => ENV['SPORTRADAR_ACCESS_LEVEL_NHL'] || 'o',
40
+ }
41
+ end
42
+
43
+ def api_version
44
+ {
45
+ 'mlb' => ENV['SPORTRADAR_API_VERSION_MLB'] || '5',
46
+ 'nba' => ENV['SPORTRADAR_API_VERSION_NBA'] || '3',
47
+ 'nfl' => ENV['SPORTRADAR_API_VERSION_NFL'] || '1',
48
+ 'nhl' => ENV['SPORTRADAR_API_VERSION_NHL'] || '4',
40
49
  }
41
50
  end
42
51
 
@@ -1,3 +1,3 @@
1
1
  module Sportradar
2
- VERSION = '0.0.21'
2
+ VERSION = '0.0.22'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stattleship
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-10-23 00:00:00.000000000 Z
12
+ date: 2017-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler