Module: NBA::CumeStatsTeam::PlayerAttributes Private
- Defined in:
- lib/nba/cume_stats_team.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Extracts player attributes from data
Class Method Summary collapse
-
.averages(data) ⇒ Hash
private
Extracts average stat attributes from data.
-
.extract(data) ⇒ Hash
private
Extracts all player attributes from data.
-
.identity(data) ⇒ Hash
private
Extracts identity attributes from data.
-
.other_stats(data) ⇒ Hash
private
Extracts other stat attributes from data.
-
.per_min(data) ⇒ Hash
private
Extracts per-minute stat attributes from data.
-
.shooting_stats(data) ⇒ Hash
private
Extracts shooting stat attributes from data.
-
.stats(data) ⇒ Hash
private
Extracts stat attributes from data.
-
.time_stats(data) ⇒ Hash
private
Extracts time stat attributes from data.
Class Method Details
.averages(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts average stat attributes from data
240 241 242 243 244 245 246 247 248 249 |
# File 'lib/nba/cume_stats_team.rb', line 240 def self.averages(data) {avg_minutes: data["AVG_MINUTES"], fgm_pg: data["FGM_PG"], fga_pg: data["FGA_PG"], fg3m_pg: data["FG3M_PG"], fg3a_pg: data["FG3A_PG"], ftm_pg: data["FTM_PG"], fta_pg: data["FTA_PG"], oreb_pg: data["OREB_PG"], dreb_pg: data["DREB_PG"], reb_pg: data["REB_PG"], ast_pg: data["AST_PG"], pf_pg: data["PF_PG"], stl_pg: data["STL_PG"], tov_pg: data["TOV_PG"], blk_pg: data["BLK_PG"], pts_pg: data["PTS_PG"]} end |
.extract(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts all player attributes from data
186 187 188 |
# File 'lib/nba/cume_stats_team.rb', line 186 def self.extract(data) identity(data).merge(stats(data)).merge(averages(data)).merge(per_min(data)) end |
.identity(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts identity attributes from data
194 195 196 197 |
# File 'lib/nba/cume_stats_team.rb', line 194 def self.identity(data) {person_id: data["PERSON_ID"], player_name: data["PLAYER_NAME"], jersey_num: data["JERSEY_NUM"], team_id: data["TEAM_ID"]} end |
.other_stats(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts other stat attributes from data
230 231 232 233 234 |
# File 'lib/nba/cume_stats_team.rb', line 230 def self.other_stats(data) {oreb: data["OREB"], dreb: data["DREB"], tot_reb: data["TOT_REB"], ast: data["AST"], pf: data["PF"], stl: data["STL"], tov: data["TOV"], blk: data["BLK"], pts: data["PTS"]} end |
.per_min(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts per-minute stat attributes from data
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/nba/cume_stats_team.rb', line 255 def self.per_min(data) {fgm_per_min: data["FGM_PER_MIN"], fga_per_min: data["FGA_PER_MIN"], fg3m_per_min: data["FG3M_PER_MIN"], fg3a_per_min: data["FG3A_PER_MIN"], ftm_per_min: data["FTM_PER_MIN"], fta_per_min: data["FTA_PER_MIN"], oreb_per_min: data["OREB_PER_MIN"], dreb_per_min: data["DREB_PER_MIN"], reb_per_min: data["REB_PER_MIN"], ast_per_min: data["AST_PER_MIN"], pf_per_min: data["PF_PER_MIN"], stl_per_min: data["STL_PER_MIN"], tov_per_min: data["TOV_PER_MIN"], blk_per_min: data["BLK_PER_MIN"], pts_per_min: data["PTS_PER_MIN"]} end |
.shooting_stats(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts shooting stat attributes from data
220 221 222 223 224 |
# File 'lib/nba/cume_stats_team.rb', line 220 def self.shooting_stats(data) {fgm: data["FGM"], fga: data["FGA"], fg_pct: data["FG_PCT"], fg3m: data["FG3M"], fg3a: data["FG3A"], fg3_pct: data["FG3_PCT"], ftm: data["FTM"], fta: data["FTA"], ft_pct: data["FT_PCT"]} end |
.stats(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts stat attributes from data
203 204 205 |
# File 'lib/nba/cume_stats_team.rb', line 203 def self.stats(data) time_stats(data).merge(shooting_stats(data)).merge(other_stats(data)) end |
.time_stats(data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts time stat attributes from data
211 212 213 214 |
# File 'lib/nba/cume_stats_team.rb', line 211 def self.time_stats(data) {gp: data["GP"], gs: data["GS"], actual_minutes: data["ACTUAL_MINUTES"], actual_seconds: data["ACTUAL_SECONDS"]} end |