Sha256: 36f79107b913d2dea337c01a3d7463c5629e49c7bb5030acd55a01b16ec7501b

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

module Sportradar
  module Api
    class Nfl::Quarter < Data
      attr_accessor :response, :id, :number, :sequence, :home_points, :away_points, :drives

      def initialize(data)
        @response = data
        @id = data["id"]
        @number = data["number"]
        @sequence = data["sequence"]
        @home_points = data["home_points"]
        # @home_points = response['scoring']['home']['points'] # from play_by_play
        @away_points = data["away_points"]
        # @away_points = response['scoring']['away']['points'] # from play_by_play
        @drives = data.dig("play_by_play", 'drive')&.map{ |drive| Sportradar::Api::Nfl::Drive.new drive }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sportradar-api-0.1.31 lib/sportradar/api/nfl/quarter.rb