Module: NBA::SynergyPlayTypes

Defined in:
lib/nba/synergy_play_types.rb

Overview

Provides methods to retrieve Synergy play type data

Constant Summary collapse

SYNERGY_PLAY_TYPE =

Result set name for play types

"SynergyPlayType".freeze
REGULAR_SEASON =

Season type constant for regular season

"Regular Season".freeze
PLAYOFFS =

Season type constant for playoffs

"Playoffs".freeze
OFFENSIVE =

Type grouping for offensive

"offensive".freeze
DEFENSIVE =

Type grouping for defensive

"defensive".freeze
PER_GAME =

Per mode constant for per game stats

"PerGame".freeze
TOTALS =

Per mode constant for totals

"Totals".freeze
ISOLATION =

Play type constant for isolation plays

"Isolation".freeze
TRANSITION =

Play type constant for transition plays

"Transition".freeze
PICK_AND_ROLL_BALL_HANDLER =

Play type constant for pick and roll ball handler plays

"PRBallHandler".freeze
PICK_AND_ROLL_ROLL_MAN =

Play type constant for pick and roll roll man plays

"PRRollman".freeze
POST_UP =

Play type constant for post up plays

"Postup".freeze
SPOT_UP =

Play type constant for spot up plays

"Spotup".freeze
HANDOFF =

Play type constant for handoff plays

"Handoff".freeze
CUT =

Play type constant for cut plays

"Cut".freeze
OFF_SCREEN =

Play type constant for off screen plays

"OffScreen".freeze
PUTBACKS =

Play type constant for putback plays

"OffRebound".freeze
MISCELLANEOUS =

Play type constant for miscellaneous plays

"Misc".freeze

Class Method Summary collapse

Class Method Details

.player_stats(play_type:, type_grouping: OFFENSIVE, season: Utils.current_season, season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT) ⇒ Collection

Retrieves synergy play type stats for players

Examples:

stats = NBA::SynergyPlayTypes.player_stats(play_type: "Isolation", type_grouping: "offensive")
stats.each { |s| puts "#{s.player_name}: #{s.ppp} PPP" }


86
87
88
89
90
91
# File 'lib/nba/synergy_play_types.rb', line 86

def self.player_stats(play_type:, type_grouping: OFFENSIVE, season: Utils.current_season,
  season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT)
  path = build_path("player", play_type, type_grouping, season, season_type: season_type, per_mode: per_mode)
  response = client.get(path)
  parse_response(response, play_type, type_grouping)
end

.team_stats(play_type:, type_grouping: OFFENSIVE, season: Utils.current_season, season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT) ⇒ Collection

Retrieves synergy play type stats for teams

Examples:

stats = NBA::SynergyPlayTypes.team_stats(play_type: "Transition", type_grouping: "offensive")
stats.each { |s| puts "#{s.team_abbreviation}: #{s.ppp} PPP" }


106
107
108
109
110
111
# File 'lib/nba/synergy_play_types.rb', line 106

def self.team_stats(play_type:, type_grouping: OFFENSIVE, season: Utils.current_season,
  season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT)
  path = build_path("team", play_type, type_grouping, season, season_type: season_type, per_mode: per_mode)
  response = client.get(path)
  parse_response(response, play_type, type_grouping)
end