Module: NBA::CommonPlayerInfo

Defined in:
lib/nba/common_player_info.rb

Overview

Provides methods to retrieve detailed player information

Constant Summary collapse

COMMON_PLAYER_INFO =

Result set name for common player info

Returns:

  • (String)

    the result set name

"CommonPlayerInfo".freeze

Class Method Summary collapse

Class Method Details

.find(player:, client: CLIENT) ⇒ PlayerInfo?

Retrieves detailed information for a player

Examples:

info = NBA::CommonPlayerInfo.find(player: 201939)
puts "#{info.display_name} - #{info.position} - #{info.team_name}"

Parameters:

  • player (Integer, Player)

    the player ID or Player object

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



22
23
24
25
26
27
# File 'lib/nba/common_player_info.rb', line 22

def self.find(player:, client: CLIENT)
  player_id = extract_player_id(player)
  path = "commonplayerinfo?PlayerID=#{player_id}"
  response = client.get(path)
  parse_response(response)
end