sportradar-api 0.11.66 → 0.11.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sportradar/api/baseball/game.rb +41 -7
- 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: 995a4c30d0039cbc7760d4365e9b843eb243cc95
|
4
|
+
data.tar.gz: 9c007e0dc730d854088c423bc564a475735d8b0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5219402bcf374aead5088fcbfd2286131967ecd042b44d23fba6399e30f8290ca3ad9fdc00618236ceef00b46e1d5cf58984a6d393a0fd71108e2c38a7843154
|
7
|
+
data.tar.gz: fc03f6e1a02dfd3eb41c6aca8956270c897e89e165d50de3aa5f5d53c872a4e7ad1d38bbcec68a0c64e0a9acfd91af9b21955661d88887b0fc4c80b296b0e86c
|
data/Gemfile.lock
CHANGED
@@ -116,8 +116,8 @@ module Sportradar
|
|
116
116
|
@scheduled = Time.parse(data["scheduled"]) if data["scheduled"]
|
117
117
|
@venue = Venue.new(data['venue']) if data['venue']
|
118
118
|
@broadcast = Broadcast.new(data['broadcast']) if !data['broadcast'].to_h.empty?
|
119
|
-
@home = Team.new(data['home'], api: api, game: self) if data['home']
|
120
|
-
@away = Team.new(data['away'], api: api, game: self) if data['away']
|
119
|
+
@home = Team.new(data['home'] || data.dig('scoring', 'home'), api: api, game: self) if data['home'] || data.dig('scoring', 'home')
|
120
|
+
@away = Team.new(data['away'] || data.dig('scoring', 'away'), api: api, game: self) if data['away'] || data.dig('scoring', 'away')
|
121
121
|
@title = data['title'] || @title || (home && away && "#{home.full_name} vs #{away.full_name}")
|
122
122
|
|
123
123
|
@duration = data['duration'] if data['duration']
|
@@ -179,9 +179,9 @@ module Sportradar
|
|
179
179
|
@inning_over = true
|
180
180
|
@bases = DEFAULT_BASES.dup
|
181
181
|
half, inn = if count['inning_half'] == 'B'
|
182
|
-
['
|
182
|
+
['E', count['inning']]
|
183
183
|
elsif count['inning_half'] == 'T'
|
184
|
-
['
|
184
|
+
['M', count['inning']]
|
185
185
|
else
|
186
186
|
[nil, 1]
|
187
187
|
end
|
@@ -290,7 +290,7 @@ module Sportradar
|
|
290
290
|
|
291
291
|
# status helpers
|
292
292
|
|
293
|
-
def realtime_state
|
293
|
+
def realtime_state(full_word: false)
|
294
294
|
if future?
|
295
295
|
'Scheduled'
|
296
296
|
elsif delayed?
|
@@ -300,7 +300,7 @@ module Sportradar
|
|
300
300
|
elsif postponed?
|
301
301
|
'Postponed'
|
302
302
|
else
|
303
|
-
|
303
|
+
full_word ? inning_word : inning_short
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
@@ -308,10 +308,44 @@ module Sportradar
|
|
308
308
|
if !count.empty?
|
309
309
|
inning_half = self.count['inning_half']
|
310
310
|
inning = self.count['inning']
|
311
|
-
"#{
|
311
|
+
"#{inning_half || 'T'}#{(inning || 1)}"
|
312
312
|
end
|
313
313
|
end
|
314
314
|
|
315
|
+
def inning_short
|
316
|
+
if !count.empty?
|
317
|
+
inning_half = self.count['inning_half']
|
318
|
+
inning = self.count['inning']
|
319
|
+
"#{half_short} #{(inning || 1).ordinalize}"
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
def inning_word
|
324
|
+
if !count.empty?
|
325
|
+
inning_half = self.count['inning_half']
|
326
|
+
inning = self.count['inning']
|
327
|
+
"#{half_word} #{(inning || 1).ordinalize}"
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
def half_word
|
332
|
+
{
|
333
|
+
'B' => 'Bottom',
|
334
|
+
'T' => 'Top',
|
335
|
+
'M' => 'Middle',
|
336
|
+
'E' => 'End',
|
337
|
+
}.freeze[self.count['inning_half']]
|
338
|
+
end
|
339
|
+
|
340
|
+
def half_short
|
341
|
+
{
|
342
|
+
'B' => 'Bot',
|
343
|
+
'T' => 'Top',
|
344
|
+
'M' => 'Mid',
|
345
|
+
'E' => 'End',
|
346
|
+
}.freeze[self.count['inning_half']]
|
347
|
+
end
|
348
|
+
|
315
349
|
def postponed?
|
316
350
|
'postponed' == status
|
317
351
|
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.11.
|
4
|
+
version: 0.11.67
|
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-09-
|
11
|
+
date: 2017-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|