sportradar-api 0.10.22 → 0.10.23

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: 307a32bb1d5ffae9868e400e8d6cd496ffe7b09d
4
- data.tar.gz: 5c2d9b0e618a02e8b6af80a1285941c364537acf
3
+ metadata.gz: 65783888edf481b1f619d7ff0458fb84be0f30fb
4
+ data.tar.gz: 27b7d237329cb9c4ba0f80e20cd8b2b6ba118bde
5
5
  SHA512:
6
- metadata.gz: 93639f731f9ee02e74cc7cac9e708d296c61c6996dd94aab57044330ada92fa3b25f51116ca6b4ab0a27b4df1e24b353c4d5802d0430807e95f9e9a0569691d2
7
- data.tar.gz: c83a59ed1e00b9cc916d5241ab1c469cd6c08c2834d210b81b2ce3abe2f1ea084733a5a61d865f14a4f3c8e324f7aafd057b4f2f2d29848bc4fff49ffb3c21e9
6
+ metadata.gz: 862807b854514ed15d1e77cd4ad62d73460d226c072a6285c90c89c121d6cb866c1a055e52cb9017c7ddaacd1e71ecc242ae65274bb095bc80f19dc121ce1d21
7
+ data.tar.gz: 8d1ec43a7d5a23ff71b9d883a3a54419eaa52a5519d58e6914e5b5c51153749f035fd7f288f774439f1abf92a1e239cfa166fb0d14474d0a510a707b4afea306
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.10.22)
4
+ sportradar-api (0.10.23)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -134,7 +134,6 @@ module Sportradar
134
134
  @outcome.update(data, source: nil)
135
135
  @count.merge!(@outcome.count || {})
136
136
  end
137
-
138
137
  create_data(@teams_hash, data['team'], klass: Team, api: api, game: self) if data['team']
139
138
  end
140
139
 
@@ -159,8 +158,23 @@ module Sportradar
159
158
  puts data.inspect
160
159
  raise e
161
160
  end
162
- def reset_bases
161
+ def advance_inning
162
+ return unless count['outs'] == 3
163
163
  @bases = DEFAULT_BASES.dup
164
+ half, inn = if count['inning_half'] == 'B'
165
+ ['T', count['inning'] += 1]
166
+ elsif count['inning_half'] == 'T'
167
+ ['B', count['inning']]
168
+ else
169
+ [nil, 1]
170
+ end
171
+ @count = {
172
+ 'balls' => 0,
173
+ 'strikes' => 0,
174
+ 'outs' => 0,
175
+ 'inning' => inn,
176
+ 'inning_half' => half,
177
+ }
164
178
  end
165
179
 
166
180
  def extract_count(data) # extract from pbp
@@ -171,6 +185,7 @@ module Sportradar
171
185
  @count.merge!(last_pitch.count)
172
186
  hi = last_pitch.at_bat.event.half_inning
173
187
  @count.merge!('inning' => hi.number.to_i, 'inning_half' => hi.half)
188
+ advance_inning
174
189
  end
175
190
 
176
191
  def home
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.10.22"
3
+ VERSION = "0.10.23"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.22
4
+ version: 0.10.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett