Module: NBA::CumeStatsPlayer::GameAttributes 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 game attributes from row data
Class Method Summary collapse
-
.extract(data) ⇒ Hash
private
Extracts all game attributes from data.
-
.identity(data) ⇒ Hash
private
Extracts identity attributes from data.
-
.other(data) ⇒ Hash
private
Extracts other stat attributes from data.
-
.rebounds(data) ⇒ Hash
private
Extracts rebound attributes from data.
-
.shooting(data) ⇒ Hash
private
Extracts shooting attributes from data.
-
.stats(data) ⇒ Hash
private
Extracts stat attributes from data.
-
.time(data) ⇒ Hash
private
Extracts time attributes from data.
Class Method Details
.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 game attributes from data
158 159 160 |
# File 'lib/nba/cume_stats_player.rb', line 158 def self.extract(data) identity(data).merge(stats(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
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/nba/cume_stats_player.rb', line 166 def self.identity(data) { game_id: data["GAME_ID"], matchup: data["MATCHUP"], game_date: data["GAME_DATE"], vs_team_id: data["VS_TEAM_ID"], vs_team_city: data["VS_TEAM_CITY"], vs_team_name: data["VS_TEAM_NAME"] } end |
.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 other stat attributes from data
217 218 219 220 221 222 |
# File 'lib/nba/cume_stats_player.rb', line 217 def self.other(data) { ast: data["AST"], pf: data["PF"], stl: data["STL"], tov: data["TOV"], blk: data["BLK"], pts: data["PTS"] } end |
.rebounds(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 attributes from data
209 210 211 |
# File 'lib/nba/cume_stats_player.rb', line 209 def self.rebounds(data) {oreb: data["OREB"], dreb: data["DREB"], reb: data["REB"]} 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
197 198 199 200 201 202 203 |
# File 'lib/nba/cume_stats_player.rb', line 197 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 |
.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
181 182 183 |
# File 'lib/nba/cume_stats_player.rb', line 181 def self.stats(data) time(data).merge(shooting(data)).merge(rebounds(data)).merge(other(data)) end |
.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 time attributes from data
189 190 191 |
# File 'lib/nba/cume_stats_player.rb', line 189 def self.time(data) {min: data["MIN"], sec: data["SEC"]} end |