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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sportradar/api/baseball/game.rb +17 -2
- data/lib/sportradar/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65783888edf481b1f619d7ff0458fb84be0f30fb
|
4
|
+
data.tar.gz: 27b7d237329cb9c4ba0f80e20cd8b2b6ba118bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862807b854514ed15d1e77cd4ad62d73460d226c072a6285c90c89c121d6cb866c1a055e52cb9017c7ddaacd1e71ecc242ae65274bb095bc80f19dc121ce1d21
|
7
|
+
data.tar.gz: 8d1ec43a7d5a23ff71b9d883a3a54419eaa52a5519d58e6914e5b5c51153749f035fd7f288f774439f1abf92a1e239cfa166fb0d14474d0a510a707b4afea306
|
data/Gemfile.lock
CHANGED
@@ -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
|
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
|