Sha256: 6df7803f6136403ea386d0a95b610eed8f51aa84c07af498159b4937f25c0e88
Contents?: true
Size: 1023 Bytes
Versions: 3
Compression:
Stored size: 1023 Bytes
Contents
module Sportradar module Api module Football class Ncaafb class Drive < Sportradar::Api::Football::Drive alias :team_id :team def end_reason plays.last.parsed_ending || 'UNKNOWN' end def over? plays.last&.parsed_ending || (overtime? && ['End of Quarter', 'End of Game'].include?(plays.last&.description)) end def handle_plays_and_events(data, **opts) create_data(@plays_hash, data['actions'], klass: Play, api: api, drive: self) if data['actions'] create_data(@events_hash, data['events'], klass: Event, api: api, drive: self) if data['events'] end def play_count plays.count(&:counted_play?) end def gain Array(plays.select(&:counted_play?)).map(&:yards).inject(:+).to_i end end end end end end # e = Event.find 17632; # sc = e.sportconnector_game; # dr = sc.pbp[-3] # pl = dr.plays.last
Version data entries
3 entries across 3 versions & 1 rubygems