Sha256: cf0b37584c99dc295b939a7e79b2e88687f7526e85f3bc6b51de71abbe06c91a

Contents?: true

Size: 1.61 KB

Versions: 47

Compression:

Stored size: 1.61 KB

Contents

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

          # NCAA MB specific

          def period_display
            if period > 3
              "#{period - 2}OT"
            elsif period == 3
              'OT'
            else
              "#{period}H"
            end
          end

          def halftime?
            status == 'halftime' || clock == '00:00' && period == 1
          end

          def team_class
            Team
          end
          def period_class
            Half
          end

          def period_name
            'half'
          end
          alias :half :period
          alias :halfs :periods

          def api
            @api ||= Sportradar::Api::Basketball::Ncaamb::Api.new
          end

          def sim!
            @api = api.sim!
            self
          end

        end
      end
    end
  end
end

__END__

ss = sr.schedule;
sr = Sportradar::Api::Basketball::Ncaamb.new
gid = "29111b80-992d-4e32-a88d-220fb4bd3121"
g = Sportradar::Api::Basketball::Ncaamb::Game.new({'id' => gid}, api: sr)
sd = sr.daily_schedule;
sd = sr.daily_schedule(Date.new(2017,1,21))
g = sd.games.detect{ |g| g.id == gid }
g = sd.games.last;
box = g.get_box;
sum = g.get_summary;
pbp = g.get_pbp;
g.periods.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

47 entries across 47 versions & 1 rubygems

Version Path
sportradar-api-0.17.1 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.17.0 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.17.0.pre lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.16.1 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.16.0 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.15.1 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.15.0 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.14.0 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.26 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.25 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.24 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.23 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.22 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.21 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.20 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.19 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.18 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.17 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.16 lib/sportradar/api/basketball/ncaamb/game.rb
sportradar-api-0.13.15 lib/sportradar/api/basketball/ncaamb/game.rb