Sha256: 10dd2d3a28f837b7fabe31d2616d9d0e7a805c115d319b4d335c35b59f5d4292

Contents?: true

Size: 1.09 KB

Versions: 57

Compression:

Stored size: 1.09 KB

Contents

module Sportradar
  module Api
    module Basketball
      class Nba
        class Game < Sportradar::Api::Basketball::Game

          # NBA specific

          def team_class
            Team
          end
          def period_class
            Quarter
          end

          def period_name
            'quarter'
          end
          alias :quarter :period
          alias :quarters :periods

          def api
            @api || Sportradar::Api::Basketball::Nba.new
          end

        end
      end
    end
  end
end

__END__

ss = sr.schedule;
sd = sr.daily_schedule;
sr = Sportradar::Api::Basketball::Nba.new
sd = sr.daily_schedule(Date.yesterday);
sd = sr.daily_schedule(Date.new(2017, 1, 20));
g = sd.games.first;
box = g.get_box;
pbp = g.get_pbp;
g.quarters.size
g.plays.size

Sportradar::Api::Basketball::Nba::Team.all.size # => 32 - includes all star teams

g1 = sd.games.first;
sd = sr.schedule;
sd = sr.daily_schedule;
sr = Sportradar::Api::Basketball::Nba.new
sd = sr.daily_schedule(Date.yesterday);
g = sd.games.last;
g.get_summary;
g.get_pbp;
g.get_box;
g.scoring
g.get_pbp; g.changed? :pbp

Version data entries

57 entries across 57 versions & 1 rubygems

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