Sha256: bdeb6bed4a88c39e4d6eef318d3536fca0eb36aafc8b1a8274e21c11c8f3789b

Contents?: true

Size: 938 Bytes

Versions: 19

Compression:

Stored size: 938 Bytes

Contents

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

        def initialize(data, **opts)
          @response = data
          @id = data["number"]
          @api = opts[:api]

          @drives_hash = {}

          update(data, **opts)
        end

        def update(data, **opts)
          @number       = data["number"]
          @sequence     = data["sequence"]
          @home_points  = data["home_points"]
          @away_points  = data["away_points"]

          @home_info = data["home"]
          @away_info = data["away"]

          create_data(@drives_hash, data['pbp'], klass: drive_class, api: api, game: self) if data['pbp']

          self
        end

        def drives
          @drives_hash.values
        end

        def drive_class
          Drive
        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/quarter.rb
sportradar-api-0.11.18 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.17 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.16 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.15 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.14 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.13 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.12 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.11 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.10 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.9 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.8 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.7 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.6 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.5 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.4 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.3 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.1 lib/sportradar/api/football/quarter.rb
sportradar-api-0.11.0 lib/sportradar/api/football/quarter.rb