Sha256: f6850deb42e582e8ddf8c3e9f7c278c14b61bac327a1a47922138596c17130ab

Contents?: true

Size: 1.03 KB

Versions: 101

Compression:

Stored size: 1.03 KB

Contents

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

      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 = parse_into_array(selector: response["play_by_play"]["drive"], klass: Sportradar::Api::Nfl::Drive) if response["play_by_play"] && response["play_by_play"]["drive"]
        @scoring = Nfl::QuarterScoring.new(data['scoring']) if data['scoring']
      end

    end

    class Nfl::QuarterScoring < Data
      attr_accessor :home, :away
      def initialize(data)
        @home = OpenStruct.new(data['home'])
        @away = OpenStruct.new(data['away'])
      end
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
sportradar-api-0.10.35 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.34 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.33 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.32 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.31 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.30 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.29 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.28 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.27 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.26 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.25 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.24 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.23 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.22 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.21 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.20 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.19 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.18 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.17 lib/sportradar/api/nfl/quarter.rb
sportradar-api-0.10.16 lib/sportradar/api/nfl/quarter.rb