lib/sportradar/api/baseball/pitch.rb in sportradar-api-0.10.41 vs lib/sportradar/api/baseball/pitch.rb in sportradar-api-0.10.42
- old
+ new
@@ -42,9 +42,17 @@
def foul?
['kF','kFT'].include? @outcome_id
end
+ def ball?
+ ['bAB', 'bB', 'bDB', 'bIB', 'bPO'].include? @outcome_id
+ end
+
+ def strike?
+ ['aKLAD1', 'aKLAD2', 'aKLAD3', 'aKLAD4', 'aKSAD1', 'aKSAD2', 'aKSAD3', 'aKSAD4', 'kF', 'kFT', 'kKL', 'kKS', 'oKLT1', 'oKLT2', 'oKLT3', 'oKLT4', 'oKST1', 'oKST2', 'oKST3', 'oKST4'].include? @outcome_id
+ end
+
def hit_ends_ab?
@hit_location.present? && !foul?
end
def parse_hit(data)