Sha256: b6162c17b4595c853788e1e13e2367c1cc7f41f7cbc6bbc13b21649e68757e7d

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

module Sportradar
  module Api
    module Football
      class Nfl
        class Drive < Sportradar::Api::Football::Drive

          def handle_plays_and_events(data, **opts)
            things = (Array(data['events']) + Array(data['actions'])).group_by { |hash| hash['type'] }

            create_data(@plays_hash,  things['play'],  klass: Play,  api: api, drive: self) if things['play']
            create_data(@events_hash, things['event'], klass: Event, api: api, drive: self) if things['setup']
            create_data(@events_hash, things['event'], klass: Event, api: api, drive: self) if things['event']
          end

        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sportradar-api-0.11.23 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.22 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.21 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.20 lib/sportradar/api/football/nfl/drive.rb