Module: NbaStats::CommonPlayerInfo

Included in:
Client
Defined in:
lib/nba_stats/stats/common_player_info.rb

Constant Summary collapse

COMMON_PLAYER_INFO_PATH =

The path of the commonplayerinfo API

'/stats/commonplayerinfo'

Instance Method Summary collapse

Instance Method Details

#common_player_info(player_id, season_type = NbaStats::Constants::SEASON_TYPE_REGULAR, league_id = NbaStats::Constants::LEAGUE_ID_NBA) ⇒ NbaStats::Resources::CommonPlayerInfo

Calls the commonplayerinfo API and returns a CommonPlayerInfo resource.

Parameters:

  • player_id (Integer)
  • season_type (String) (defaults to: NbaStats::Constants::SEASON_TYPE_REGULAR)
  • league_id (String) (defaults to: NbaStats::Constants::LEAGUE_ID_NBA)

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
# 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