Module: NBA::PlayerDashPtPass

Defined in:
lib/nba/player_dash_pt_pass.rb

Overview

Provides methods to retrieve player 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(player:, team: 0, season: Utils.current_season, season_type: "Regular Season", per_mode: "PerGame", client: CLIENT) ⇒ Collection

Retrieves passes made statistics for a player

Examples:

stats = NBA::PlayerDashPtPass.passes_made(player: 201939)
stats.each { |s| puts "#{s.pass_to}: #{s.ast} assists" }

Parameters:

  • player (Integer, Player)

    the player ID or Player object

  • team (Integer, Team) (defaults to: 0)

    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



33
34
35
36
37
# File 'lib/nba/player_dash_pt_pass.rb', line 33

def self.passes_made(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: PASSES_MADE}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves passes received statistics for a player

Examples:

stats = NBA::PlayerDashPtPass.passes_received(player: 201939)
stats.each { |s| puts "#{s.pass_to}: #{s.pass} passes" }

Parameters:

  • player (Integer, Player)

    the player ID or Player object

  • team (Integer, Team) (defaults to: 0)

    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



52
53
54
55
56
# File 'lib/nba/player_dash_pt_pass.rb', line 52

def self.passes_received(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: PASSES_RECEIVED}
  fetch_stats(player, team, season, options, client: client)
end