Module: NBA::VideoDetails

Defined in:
lib/nba/video_details.rb

Overview

Provides methods to retrieve video details

Constant Summary collapse

RESULT_SET_NAME =

Result set name for video details

Returns:

  • (String)

    the result set name

"VideoDetails".freeze

Class Method Summary collapse

Class Method Details

.find(player:, team:, season:, context_measure: "FGA", season_type: "Regular Season", league: League::NBA, client: CLIENT) ⇒ Collection

Retrieves video details for plays

Examples:

videos = NBA::VideoDetails.find(player: 201939, team: Team::GSW, season: 2023)
videos.each { |v| puts "#{v.description}: #{v.available?}" }

Parameters:

  • player (Integer, Player)

    the player ID or Player object

  • team (Integer, Team)

    the team ID or Team object

  • season (Integer)

    the season year

  • context_measure (String) (defaults to: "FGA")

    the context measure (default: “FGA”)

  • season_type (String) (defaults to: "Regular Season")

    the season type (default: “Regular Season”)

  • league (String, League) (defaults to: League::NBA)

    the league ID or League object (default NBA)

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



28
29
30
31
32
33
34
35
36
37
# File 'lib/nba/video_details.rb', line 28

def self.find(player:, team:, season:, context_measure: "FGA", season_type: "Regular Season", league: League::NBA,
  client: CLIENT)
  player_id = Utils.extract_id(player)
  team_id = Utils.extract_id(team)
  league_id = Utils.extract_league_id(league)
  path = "videodetails?PlayerID=#{player_id}&TeamID=#{team_id}&Season=#{Utils.format_season(season)}" \
         "&ContextMeasure=#{context_measure}&SeasonType=#{season_type}&LeagueID=#{league_id}"
  response = client.get(path)
  parse_response(response)
end