module SportsDataApi::Nba

Constants

API_VERSION
BASE_URL
DIR
SPORT

Public Class Methods

daily(year, month, day) click to toggle source

Fetches NBA daily schedule for a given date

# File lib/sports_data_api/nba.rb, line 50
def daily(year, month, day)
  Games.new(response_json("/games/#{year}/#{month}/#{day}/schedule.json"))
end
game_summary(game_id) click to toggle source

Fetches NBA game summary for a given game

# File lib/sports_data_api/nba.rb, line 38
def game_summary(game_id)
  Game.new(json: response_json("/games/#{game_id}/summary.json"))
end
schedule(year, season) click to toggle source

Fetches NBA season schedule for a given year and season

# File lib/sports_data_api/nba.rb, line 23
def schedule(year, season)
  season = season.to_s.upcase.to_sym
  raise Error.new("#{season} is not a valid season") unless Season.valid?(season)

  Season.new(response_json("/games/#{year}/#{season}/schedule.json"))
end
team_roster(team_id) click to toggle source

Fetches NBA team roster

# File lib/sports_data_api/nba.rb, line 32
def team_roster(team_id)
  Team.new(response_json("/teams/#{team_id}/profile.json"))
end
teams() click to toggle source

Fetches all NBA teams

# File lib/sports_data_api/nba.rb, line 44
def teams
  Teams.new(response_json('/league/hierarchy.json'))
end