Class: NBA::Roster

Inherits:
Object
  • Object
show all
Defined in:
lib/nba/roster.rb

Constant Summary collapse

BASE_URI =
'http://stats.nba.com/stats'

Class Method Summary collapse

Class Method Details

.get_team_roster(teamId = 0, leagueId = "00", season = "2015-16") ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/nba/roster.rb', line 4

def self.get_team_roster(teamId=0,leagueId="00",season="2015-16")
  res = HTTP.get(BASE_URI+'/commonteamroster', :params => {
    :TeamID => teamId,
    :LeagueID => leagueId,
    :Season => season
  })
  if res.code == 200
    return JSON.parse(res.body)
  end
  return res.code
end