Sha256: c5fe79388baa8dad53537856b873cacf3d919b207294fd866a1564128eaa210f

Contents?: true

Size: 1.17 KB

Versions: 52

Compression:

Stored size: 1.17 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::Api.new
          end

          def sim!
            @api = api.sim!
            self
          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

52 entries across 52 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.20.1 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.20.0 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.20.0.pre lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.6 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.5 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.4 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.3 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.2 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.1 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.19.0 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.18.1 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.18.0 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.6 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.5 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.5.pre lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.4 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.3 lib/sportradar/api/basketball/nba/game.rb
sportradar-api-0.17.2 lib/sportradar/api/basketball/nba/game.rb