Module: NBA::TeamEstimatedMetrics

Defined in:
lib/nba/team_estimated_metrics.rb

Overview

Provides methods to retrieve team estimated metrics

Constant Summary collapse

REGULAR_SEASON =

Season type constant for regular season

Returns:

  • (String)

    the season type

"Regular Season".freeze
PLAYOFFS =

Season type constant for playoffs

Returns:

  • (String)

    the season type

"Playoffs".freeze
RESULT_SET_NAME =

Result set name for team estimated metrics

Returns:

  • (String)

    the result set name

"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:

  • season (Integer) (defaults to: Utils.current_season)

    the season year

  • season_type (String) (defaults to: REGULAR_SEASON)

    the season type

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of estimated metrics stats



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