Module: NBA::CumeStatsPlayer::TotalAttributes Private

Defined in:
lib/nba/cume_stats_player.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 total attributes from row data

Class Method Summary collapse

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



285
286
287
# File 'lib/nba/cume_stats_player.rb', line 285

def self.averages(data)
  avg_time(data).merge(avg_shooting(data)).merge(avg_other(data))
end

.avg_other(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 other stat attributes from data



314
315
316
317
318
319
320
321
# File 'lib/nba/cume_stats_player.rb', line 314

def self.avg_other(data)
  {
    avg_tot_reb: data["AVG_TOT_REB"], avg_ast: data["AVG_AST"],
    avg_pf: data["AVG_PF"], avg_stl: data["AVG_STL"],
    avg_tov: data["AVG_TOV"], avg_blk: data["AVG_BLK"],
    avg_pts: data["AVG_PTS"]
  }
end

.avg_shooting(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 shooting attributes from data



301
302
303
304
305
306
307
308
# File 'lib/nba/cume_stats_player.rb', line 301

def self.avg_shooting(data)
  {
    avg_fgm: data["AVG_FGM"], avg_fga: data["AVG_FGA"],
    avg_fg3m: data["AVG_FG3M"], avg_fg3a: data["AVG_FG3A"],
    avg_ftm: data["AVG_FTM"], avg_fta: data["AVG_FTA"],
    avg_oreb: data["AVG_OREB"], avg_dreb: data["AVG_DREB"]
  }
end

.avg_time(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 time attributes from data



293
294
295
# File 'lib/nba/cume_stats_player.rb', line 293

def self.avg_time(data)
  {avg_min: data["AVG_MIN"], avg_sec: data["AVG_SEC"]}
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 total attributes from data



232
233
234
# File 'lib/nba/cume_stats_player.rb', line 232

def self.extract(data)
  identity(data).merge(totals(data)).merge(averages(data)).merge(maximums(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



240
241
242
243
244
245
246
247
# File 'lib/nba/cume_stats_player.rb', line 240

def self.identity(data)
  {
    player_id: data["PLAYER_ID"], player_name: data["PLAYER_NAME"],
    jersey_num: data["JERSEY_NUM"], season: data["SEASON"],
    gp: data["GP"], gs: data["GS"],
    actual_minutes: data["ACTUAL_MINUTES"], actual_seconds: data["ACTUAL_SECONDS"]
  }
end

.max_other(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 maximum other stat attributes from data



349
350
351
352
353
354
355
# File 'lib/nba/cume_stats_player.rb', line 349

def self.max_other(data)
  {
    max_ast: data["MAX_AST"], max_pf: data["MAX_PF"],
    max_stl: data["MAX_STL"], max_tov: data["MAX_TOV"],
    max_blk: data["MAX_BLK"], max_pts: data["MAX_PTS"]
  }
end

.max_shooting(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 maximum shooting attributes from data



335
336
337
338
339
340
341
342
343
# File 'lib/nba/cume_stats_player.rb', line 335

def self.max_shooting(data)
  {
    max_min: data["MAX_MIN"], max_fgm: data["MAX_FGM"],
    max_fga: data["MAX_FGA"], max_fg3m: data["MAX_FG3M"],
    max_fg3a: data["MAX_FG3A"], max_ftm: data["MAX_FTM"],
    max_fta: data["MAX_FTA"], max_oreb: data["MAX_OREB"],
    max_dreb: data["MAX_DREB"], max_reb: data["MAX_REB"]
  }
end

.maximums(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 maximum stat attributes from data



327
328
329
# File 'lib/nba/cume_stats_player.rb', line 327

def self.maximums(data)
  max_shooting(data).merge(max_other(data))
end

.rebounds_and_other(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 rebound and other stat attributes from data



273
274
275
276
277
278
279
# File 'lib/nba/cume_stats_player.rb', line 273

def self.rebounds_and_other(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

.shooting(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 attributes from data



261
262
263
264
265
266
267
# File 'lib/nba/cume_stats_player.rb', line 261

def self.shooting(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

.totals(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 total stat attributes from data



253
254
255
# File 'lib/nba/cume_stats_player.rb', line 253

def self.totals(data)
  shooting(data).merge(rebounds_and_other(data))
end