Module: NBA::PlayerCareerByCollegeRollup

Defined in:
lib/nba/player_career_by_college_rollup.rb

Overview

Provides methods to retrieve player career stats aggregated by college region

Constant Summary collapse

PER_GAME =

Per mode constant for per game stats

Returns:

  • (String)

    the per mode

"PerGame".freeze
TOTALS =

Per mode constant for totals

Returns:

  • (String)

    the per mode

"Totals".freeze
EAST =

Result set name for East region colleges

Returns:

  • (String)

    the result set name

"East".freeze
MIDWEST =

Result set name for Midwest region colleges

Returns:

  • (String)

    the result set name

"Midwest".freeze
SOUTH =

Result set name for South region colleges

Returns:

  • (String)

    the result set name

"South".freeze
WEST =

Result set name for West region colleges

Returns:

  • (String)

    the result set name

"West".freeze

Class Method Summary collapse

Class Method Details

.east(per_mode: TOTALS, season: nil, client: CLIENT) ⇒ Collection

Retrieves career statistics for players from East region colleges

Examples:

stats = NBA::PlayerCareerByCollegeRollup.east
stats.each { |s| puts "#{s.player_name} (#{s.college}): #{s.pts} career points" }

Parameters:

  • per_mode (String) (defaults to: TOTALS)

    the per mode (Totals or PerGame)

  • season (String, nil) (defaults to: nil)

    optional season filter

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of college player stats



43
44
45
46
# File 'lib/nba/player_career_by_college_rollup.rb', line 43

def self.east(per_mode: TOTALS, season: nil, client: CLIENT)
  path = build_path(per_mode, season)
  ResponseParser.parse(client.get(path), result_set: EAST) { |data| build_stat(data) }
end

.midwest(per_mode: TOTALS, season: nil, client: CLIENT) ⇒ Collection

Retrieves career statistics for players from Midwest region colleges

Examples:

stats = NBA::PlayerCareerByCollegeRollup.midwest
stats.each { |s| puts "#{s.player_name} (#{s.college}): #{s.pts} career points" }

Parameters:

  • per_mode (String) (defaults to: TOTALS)

    the per mode (Totals or PerGame)

  • season (String, nil) (defaults to: nil)

    optional season filter

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of college player stats



59
60
61
62
# File 'lib/nba/player_career_by_college_rollup.rb', line 59

def self.midwest(per_mode: TOTALS, season: nil, client: CLIENT)
  path = build_path(per_mode, season)
  ResponseParser.parse(client.get(path), result_set: MIDWEST) { |data| build_stat(data) }
end

.south(per_mode: TOTALS, season: nil, client: CLIENT) ⇒ Collection

Retrieves career statistics for players from South region colleges

Examples:

stats = NBA::PlayerCareerByCollegeRollup.south
stats.each { |s| puts "#{s.player_name} (#{s.college}): #{s.pts} career points" }

Parameters:

  • per_mode (String) (defaults to: TOTALS)

    the per mode (Totals or PerGame)

  • season (String, nil) (defaults to: nil)

    optional season filter

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of college player stats



75
76
77
78
# File 'lib/nba/player_career_by_college_rollup.rb', line 75

def self.south(per_mode: TOTALS, season: nil, client: CLIENT)
  path = build_path(per_mode, season)
  ResponseParser.parse(client.get(path), result_set: SOUTH) { |data| build_stat(data) }
end

.west(per_mode: TOTALS, season: nil, client: CLIENT) ⇒ Collection

Retrieves career statistics for players from West region colleges

Examples:

stats = NBA::PlayerCareerByCollegeRollup.west
stats.each { |s| puts "#{s.player_name} (#{s.college}): #{s.pts} career points" }

Parameters:

  • per_mode (String) (defaults to: TOTALS)

    the per mode (Totals or PerGame)

  • season (String, nil) (defaults to: nil)

    optional season filter

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of college player stats



91
92
93
94
# File 'lib/nba/player_career_by_college_rollup.rb', line 91

def self.west(per_mode: TOTALS, season: nil, client: CLIENT)
  path = build_path(per_mode, season)
  ResponseParser.parse(client.get(path), result_set: WEST) { |data| build_stat(data) }
end