Sha256: 1009bd8d86693c23063f3425e4ac7f75706c56a55f3d48b299e2224f48201aee

Contents?: true

Size: 1.11 KB

Versions: 181

Compression:

Stored size: 1.11 KB

Contents

module Sportradar
  module Api
    module Basketball
      class Ncaamb
        class Bracket < Data
          attr_accessor :response, :id, :name, :location, :start, :end

          def initialize(data, **opts)
            @response   = data
            @api        = opts[:api]
            @tournament = opts[:tournament]

            @id         = data['id']

            @games_hash = {}

            update(data)
          end

          def update(data, **opts)
            @response = data

            @name     = data['name']                  if data['name']
            @location = data['location']              if data['location']

            # update_games(data['games'])               if data['games']
            update_participants(data['participants']) if data['participants']
            self
          end

          # def games
          #   @games_hash.values
          # end

          # rounds are either bracketed (bracketed) or not (games)
          # def update_games(data)
          #   create_data(@games_hash, data, klass: Game, api: @api, season: self)
          # end

        end
      end
    end
  end
end

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
sportradar-api-0.10.43 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.42 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.41 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.40 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.39 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.38 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.37 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.36 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.35 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.34 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.33 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.32 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.31 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.30 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.29 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.28 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.27 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.26 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.25 lib/sportradar/api/basketball/ncaamb/bracket.rb
sportradar-api-0.10.24 lib/sportradar/api/basketball/ncaamb/bracket.rb