Module: NBA::TeamDashPtPass

Defined in:
lib/nba/team_dash_pt_pass.rb

Overview

Provides methods to retrieve team tracking pass statistics

Constant Summary collapse

PASSES_MADE =

Result set name for passes made

Returns:

  • (String)

    the result set name

"PassesMade".freeze
PASSES_RECEIVED =

Result set name for passes received

Returns:

  • (String)

    the result set name

"PassesReceived".freeze

Class Method Summary collapse

Class Method Details

.passes_made(team:, season: Utils.current_season, season_type: "Regular Season", per_mode: "PerGame", client: CLIENT) ⇒ Collection

Retrieves passes made statistics for a team

Examples:

stats = NBA::TeamDashPtPass.passes_made(team: 1610612744)
stats.each { |s| puts "#{s.pass_from}: #{s.ast} assists" }

Parameters:

  • team (Integer, Team)

    the team ID or Team object

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

    the season year

  • season_type (String) (defaults to: "Regular Season")

    the season type

  • per_mode (String) (defaults to: "PerGame")

    the per mode

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of pass statistics



32
33
34
35
# File 'lib/nba/team_dash_pt_pass.rb', line 32

def self.passes_made(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, PASSES_MADE, client: client)
end

.passes_received(team:, season: Utils.current_season, season_type: "Regular Season", per_mode: "PerGame", client: CLIENT) ⇒ Collection

Retrieves passes received statistics for a team

Examples:

stats = NBA::TeamDashPtPass.passes_received(team: 1610612744)
stats.each { |s| puts "#{s.pass_to}: #{s.pass} passes" }

Parameters:

  • team (Integer, Team)

    the team ID or Team object

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

    the season year

  • season_type (String) (defaults to: "Regular Season")

    the season type

  • per_mode (String) (defaults to: "PerGame")

    the per mode

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of pass statistics



49
50
51
52
# File 'lib/nba/team_dash_pt_pass.rb', line 49

def self.passes_received(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, PASSES_RECEIVED, client: client)
end