Sha256: 37386f254ab8ae3d610c93e28fd740809832f6b11e6ac6e5b1b8d8c03db77d31

Contents?: true

Size: 894 Bytes

Versions: 17

Compression:

Stored size: 894 Bytes

Contents

module Sportradar
  module Api
    module Odds
      class Sport < Data
        attr_accessor :response, :api, :id, :name, :type


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

          @id       = data['id']
          @name     = data['name']
          @type     = data['type']

          @competitions_hash = {}
        end

        def update(data, **opts)

        end


        def competitions
          @competitions_hash.values
        end

        def get_competitions
          data = api.get_data(path_competitions);
          create_data(@competitions_hash, data['competitions'], klass: Sport, api: api)
          data
        end

        # url path helpers
        def path_base
          "sports/#{id}"
        end

        def path_competitions
          "#{path_base}/competitions"
        end


      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/odds/sport.rb
sportradar-api-0.20.1 lib/sportradar/api/odds/sport.rb
sportradar-api-0.20.0 lib/sportradar/api/odds/sport.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/odds/sport.rb
sportradar-api-0.20.0.pre lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.6 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.5 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.4 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.3 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.2 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.1 lib/sportradar/api/odds/sport.rb
sportradar-api-0.19.0 lib/sportradar/api/odds/sport.rb
sportradar-api-0.18.1 lib/sportradar/api/odds/sport.rb
sportradar-api-0.18.0 lib/sportradar/api/odds/sport.rb
sportradar-api-0.17.6 lib/sportradar/api/odds/sport.rb
sportradar-api-0.17.5 lib/sportradar/api/odds/sport.rb
sportradar-api-0.17.5.pre lib/sportradar/api/odds/sport.rb