lib/sportradar/api/football/ncaafb/drive.rb in sportradar-api-0.11.31 vs lib/sportradar/api/football/ncaafb/drive.rb in sportradar-api-0.11.32
- old
+ new
@@ -23,12 +23,10 @@
plays.count(&:counted_play?)
end
def gain
Array(plays.select(&:counted_play?)).sum do |play|
- Array(play.players).sum do |p|
- p.dig('passing', 'yds').to_i + p.dig('rushing', 'yds').to_i
- end
+ Array(play.statistics.pass).map(&:yards).inject(:+) + Array(play.statistics.rush).map(&:yards).inject(:+)
end
end
end
end