module NbaStats::CommonPlayerInfo

Constants

COMMON_PLAYER_INFO_PATH

The path of the commonplayerinfo API

Public Instance Methods

common_player_info( player_id, season_type=NbaStats::Constants::SEASON_TYPE_REGULAR, league_id=NbaStats::Constants::LEAGUE_ID_NBA ) click to toggle source

Calls the commonplayerinfo API and returns a CommonPlayerInfo resource.

@param player_id [Integer] @param season_type [String] @param league_id [String] @return [NbaStats::Resources::CommonPlayerInfo]

# File lib/nba_stats/stats/common_player_info.rb, line 17
def common_player_info(
    player_id,
    season_type=NbaStats::Constants::SEASON_TYPE_REGULAR,
    league_id=NbaStats::Constants::LEAGUE_ID_NBA
)
  NbaStats::Resources::CommonPlayerInfo.new(
      get(COMMON_PLAYER_INFO_PATH, {
          :PlayerID => player_id,
          :SeasonType => season_type,
          :LeagueID => league_id
      })
)
end