Class: NBA::BoxScoreScoringTeamStat

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/nba/box_score_scoring_team_stat.rb

Overview

Represents a team’s scoring box score statistics for a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400565"


15
# File 'lib/nba/box_score_scoring_team_stat.rb', line 15

attribute :game_id, Shale::Type::String

#minString

Returns total minutes played

Examples:

stat.min #=> "240:00"


55
# File 'lib/nba/box_score_scoring_team_stat.rb', line 55

attribute :min, Shale::Type::String

#pct_ast_2pmFloat

Returns percentage of 2-point makes that were assisted

Examples:

stat.pct_ast_2pm #=> 0.70


135
# File 'lib/nba/box_score_scoring_team_stat.rb', line 135

attribute :pct_ast_2pm, Shale::Type::Float

#pct_ast_3pmFloat

Returns percentage of 3-point makes that were assisted

Examples:

stat.pct_ast_3pm #=> 0.88


151
# File 'lib/nba/box_score_scoring_team_stat.rb', line 151

attribute :pct_ast_3pm, Shale::Type::Float

#pct_ast_fgmFloat

Returns percentage of field goal makes that were assisted

Examples:

stat.pct_ast_fgm #=> 0.78


167
# File 'lib/nba/box_score_scoring_team_stat.rb', line 167

attribute :pct_ast_fgm, Shale::Type::Float

#pct_fga_2ptFloat

Returns percentage of field goals from 2-point range

Examples:

stat.pct_fga_2pt #=> 0.52


63
# File 'lib/nba/box_score_scoring_team_stat.rb', line 63

attribute :pct_fga_2pt, Shale::Type::Float

#pct_fga_3ptFloat

Returns percentage of field goals from 3-point range

Examples:

stat.pct_fga_3pt #=> 0.48


71
# File 'lib/nba/box_score_scoring_team_stat.rb', line 71

attribute :pct_fga_3pt, Shale::Type::Float

#pct_pts_2ptFloat

Returns percentage of points from 2-point shots

Examples:

stat.pct_pts_2pt #=> 0.42


79
# File 'lib/nba/box_score_scoring_team_stat.rb', line 79

attribute :pct_pts_2pt, Shale::Type::Float

#pct_pts_2pt_mrFloat

Returns percentage of points from mid-range 2-point shots

Examples:

stat.pct_pts_2pt_mr #=> 0.18


87
# File 'lib/nba/box_score_scoring_team_stat.rb', line 87

attribute :pct_pts_2pt_mr, Shale::Type::Float

#pct_pts_3ptFloat

Returns percentage of points from 3-point shots

Examples:

stat.pct_pts_3pt #=> 0.45


95
# File 'lib/nba/box_score_scoring_team_stat.rb', line 95

attribute :pct_pts_3pt, Shale::Type::Float

#pct_pts_fbFloat

Returns percentage of points from fast break

Examples:

stat.pct_pts_fb #=> 0.15


103
# File 'lib/nba/box_score_scoring_team_stat.rb', line 103

attribute :pct_pts_fb, Shale::Type::Float

#pct_pts_ftFloat

Returns percentage of points from free throws

Examples:

stat.pct_pts_ft #=> 0.13


111
# File 'lib/nba/box_score_scoring_team_stat.rb', line 111

attribute :pct_pts_ft, Shale::Type::Float

#pct_pts_off_tovFloat

Returns percentage of points off turnovers

Examples:

stat.pct_pts_off_tov #=> 0.16


119
# File 'lib/nba/box_score_scoring_team_stat.rb', line 119

attribute :pct_pts_off_tov, Shale::Type::Float

#pct_pts_paintFloat

Returns percentage of points in the paint

Examples:

stat.pct_pts_paint #=> 0.38


127
# File 'lib/nba/box_score_scoring_team_stat.rb', line 127

attribute :pct_pts_paint, Shale::Type::Float

#pct_uast_2pmFloat

Returns percentage of 2-point makes that were unassisted

Examples:

stat.pct_uast_2pm #=> 0.30


143
# File 'lib/nba/box_score_scoring_team_stat.rb', line 143

attribute :pct_uast_2pm, Shale::Type::Float

#pct_uast_3pmFloat

Returns percentage of 3-point makes that were unassisted

Examples:

stat.pct_uast_3pm #=> 0.12


159
# File 'lib/nba/box_score_scoring_team_stat.rb', line 159

attribute :pct_uast_3pm, Shale::Type::Float

#pct_uast_fgmFloat

Returns percentage of field goal makes that were unassisted

Examples:

stat.pct_uast_fgm #=> 0.22


175
# File 'lib/nba/box_score_scoring_team_stat.rb', line 175

attribute :pct_uast_fgm, Shale::Type::Float

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"


39
# File 'lib/nba/box_score_scoring_team_stat.rb', line 39

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"


47
# File 'lib/nba/box_score_scoring_team_stat.rb', line 47

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744


23
# File 'lib/nba/box_score_scoring_team_stat.rb', line 23

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

stat.team_name #=> "Warriors"


31
# File 'lib/nba/box_score_scoring_team_stat.rb', line 31

attribute :team_name, Shale::Type::String

Instance Method Details

#gameGame?

Returns the game object for this box score

Examples:

stat.game #=> #<NBA::Game>


193
194
195
# File 'lib/nba/box_score_scoring_team_stat.rb', line 193

def game
  Games.find(game_id)
end

#teamTeam?

Returns the team object

Examples:

stat.team #=> #<NBA::Team>


183
184
185
# File 'lib/nba/box_score_scoring_team_stat.rb', line 183

def team
  Teams.find(team_id)
end