Module: NBA::TeamEstimatedMetrics

Defined in:
lib/nba/team_estimated_metrics.rb

Overview

Provides methods to retrieve team estimated metrics

API:

  • public

Constant Summary collapse

REGULAR_SEASON =

Season type constant for regular season

Returns:

  • the season type

API:

  • public

"Regular Season".freeze
PLAYOFFS =

Season type constant for playoffs

Returns:

  • the season type

API:

  • public

"Playoffs".freeze
RESULT_SET_NAME =

Result set name for team estimated metrics

Returns:

  • the result set name

API:

  • public

"TeamEstimatedMetrics".freeze

Class Method Summary collapse

Class Method Details

.all(season: Utils.current_season, season_type: REGULAR_SEASON, client: CLIENT) ⇒ Collection

Retrieves estimated metrics for all teams

Examples:

stats = NBA::TeamEstimatedMetrics.all
stats.each { |s| puts "#{s.team_name}: #{s.e_net_rating} net rating" }

Parameters:

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: REGULAR_SEASON)

    the season type

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of estimated metrics stats

API:

  • public



36
37
38
39
# File 'lib/nba/team_estimated_metrics.rb', line 36

def self.all(season: Utils.current_season, season_type: REGULAR_SEASON, client: CLIENT)
  path = build_path(season, season_type)
  ResponseParser.parse(client.get(path), result_set: RESULT_SET_NAME) { |data| build_stat(data) }
end