Sha256: d6d42a7735f6e321e659aeb208d469be2ed560ccadc0e877d5b573b8d1d78840

Contents?: true

Size: 1.31 KB

Versions: 61

Compression:

Stored size: 1.31 KB

Contents

module Sportradar
  module Api
    module Football
      class Ncaafb
        class Team < Sportradar::Api::Football::Team

          def alias
            id
          end

          def used_timeouts
            3 - remaining_timeouts.to_i
          end

          def parse_records(data)
            @records['overall'] = Record.new(data['overall'], type: 'overall')
            # data['records'].each { |record| @records[record['record_type']] = Record.new(record, type: record['record_type']) }
          end

          def players
            get_roster if @players_hash.empty?
            @players_hash.values
          end
          alias :roster :players
          
          def player_class
            Player
          end

          def path_roster
            "#{ path_base }/roster"
          end
          def path_season_stats(year = season_year, season = ncaafb_season)
            "#{path_base}/#{year}/#{ncaafb_season}/statistics"
          end

          def api
            @api || Sportradar::Api::Football::Ncaafb::Api.new
          end
          def ncaafb_season
            @type || default_season
          end

        end

      end
    end
  end
end

__END__

ncaafb = Marshal.load(File.binread('ncaafb.bin'));

t = ncaafb.teams.first
data = t.get_season_stats
data = t.get_season_stats(2016)
t.players.count

Version data entries

61 entries across 61 versions & 1 rubygems

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