Sha256: 85c2adf212c90b342aa2c97adc5c819fa242181ca4f7b18d178a950a0ec55fdc

Contents?: true

Size: 663 Bytes

Versions: 19

Compression:

Stored size: 663 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, game: self) if things['play']
            create_data(@events_hash, things['event'], klass: Event, api: api, game: self) if things['setup']
            create_data(@events_hash, things['event'], klass: Event, api: api, game: self) if things['event']
          end

        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sportradar-api-0.11.19 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.18 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.17 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.16 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.15 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.14 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.13 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.12 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.11 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.10 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.9 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.8 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.7 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.6 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.5 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.4 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.3 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.1 lib/sportradar/api/football/nfl/drive.rb
sportradar-api-0.11.0 lib/sportradar/api/football/nfl/drive.rb