sportradar-api 0.11.66 → 0.11.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdcab50319da2186200bc43e6d059ba1a27e0c8e
4
- data.tar.gz: 0e7264d72d9ac915747f71b08495ece254cd754b
3
+ metadata.gz: 995a4c30d0039cbc7760d4365e9b843eb243cc95
4
+ data.tar.gz: 9c007e0dc730d854088c423bc564a475735d8b0c
5
5
  SHA512:
6
- metadata.gz: 03c870ab0700c2c42983fa174a14738840396c0b02dcddee66aef651aedcb506425a8a00281ff95c26781370049f06846d323efde3ab8e40636fd3da27470cf8
7
- data.tar.gz: 34428d4d9600b738a74765d3e5265d18c2daed87973dc8b0a2d616e6a9a2a031518dbb96aa0ba94d922b44f6fa21194565212a8c382f8f7fbeb32eb9ffd9b92b
6
+ metadata.gz: 5219402bcf374aead5088fcbfd2286131967ecd042b44d23fba6399e30f8290ca3ad9fdc00618236ceef00b46e1d5cf58984a6d393a0fd71108e2c38a7843154
7
+ data.tar.gz: fc03f6e1a02dfd3eb41c6aca8956270c897e89e165d50de3aa5f5d53c872a4e7ad1d38bbcec68a0c64e0a9acfd91af9b21955661d88887b0fc4c80b296b0e86c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.11.66)
4
+ sportradar-api (0.11.67)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -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
- ['T', count['inning'] += 1]
182
+ ['E', count['inning']]
183
183
  elsif count['inning_half'] == 'T'
184
- ['B', count['inning']]
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
- inning_abbr
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
- "#{(inning_half == 'B' ? 'Bottom' : 'Top')} #{(inning || 1).ordinalize}"
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
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.11.66"
3
+ VERSION = "0.11.67"
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.11.66
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-19 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler