Sha256: 29eca295c4dc7569b6eab8111bbaf8c215bc444c5a2600368576733de3536d7d

Contents?: true

Size: 859 Bytes

Versions: 121

Compression:

Stored size: 859 Bytes

Contents

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

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

          def path_season_stats(year = season_year, season = nfl_season)
            "seasontd/#{year}/#{nfl_season}/teams/#{ id }/statistics"
          end

          def api
            @api || Sportradar::Api::Football::Nfl::Api.new
          end
          def nfl_season
            @type || default_season
          end

        end

      end
    end
  end
end

__END__

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

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

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
sportradar-api-0.19.4 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.19.3 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.19.2 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.19.1 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.19.0 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.18.1 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.18.0 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.6 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.5 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.5.pre lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.4 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.3 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.2 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.1 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.0 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.17.0.pre lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.16.1 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.16.0 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.15.1 lib/sportradar/api/football/nfl/team.rb
sportradar-api-0.15.0 lib/sportradar/api/football/nfl/team.rb