module SportsDataApi::Nhl
Constants
- API_VERSION
- BASE_URL
- DIR
- SPORT
Public Class Methods
daily(year, month, day)
click to toggle source
Fetches NHL daily schedule for a given date
# File lib/sports_data_api/nhl.rb, line 49 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 NHL game summary for a given game
# File lib/sports_data_api/nhl.rb, line 37 def game_summary(game_id) Game.new(json: response_json("/games/#{game_id}/summary.json")) end
schedule(year, season)
click to toggle source
Fetches NHL season schedule for a given year and season
# File lib/sports_data_api/nhl.rb, line 22 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 NHL team roster
# File lib/sports_data_api/nhl.rb, line 31 def team_roster(team_id) Team.new(response_json("/teams/#{team_id}/profile.json")) end
teams()
click to toggle source
Fetches all NHL teams
# File lib/sports_data_api/nhl.rb, line 43 def teams Teams.new(response_json('/league/hierarchy.json')) end