Class: NBA::BoxScoreStarterBenchStat

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

Overview

Represents starter vs bench aggregate statistics for a team in a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns assists

Examples:

stat.ast #=> 20

Returns:

  • (Integer)

    assists



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

attribute :ast, Shale::Type::Integer

#blkInteger

Returns blocks

Examples:

stat.blk #=> 4

Returns:

  • (Integer)

    blocks



183
# File 'lib/nba/box_score_starter_bench_stat.rb', line 183

attribute :blk, Shale::Type::Integer

#drebInteger

Returns defensive rebounds

Examples:

stat.dreb #=> 22

Returns:

  • (Integer)

    defensive rebounds



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

attribute :dreb, Shale::Type::Integer

#fg3_pctFloat

Returns three-point percentage

Examples:

stat.fg3_pct #=> 0.4

Returns:

  • (Float)

    three-point percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns three-pointers attempted

Examples:

stat.fg3a #=> 25

Returns:

  • (Integer)

    three-pointers attempted



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

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns three-pointers made

Examples:

stat.fg3m #=> 10

Returns:

  • (Integer)

    three-pointers made



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

attribute :fg3m, Shale::Type::Integer

#fg_pctFloat

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.5

Returns:

  • (Float)

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fgaInteger

Returns field goals attempted

Examples:

stat.fga #=> 70

Returns:

  • (Integer)

    field goals attempted



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

attribute :fga, Shale::Type::Integer

#fgmInteger

Returns field goals made

Examples:

stat.fgm #=> 35

Returns:

  • (Integer)

    field goals made



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

attribute :fgm, Shale::Type::Integer

#ft_pctFloat

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.833

Returns:

  • (Float)

    free throw percentage



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

attribute :ft_pct, Shale::Type::Float

#ftaInteger

Returns free throws attempted

Examples:

stat.fta #=> 18

Returns:

  • (Integer)

    free throws attempted



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

attribute :fta, Shale::Type::Integer

#ftmInteger

Returns free throws made

Examples:

stat.ftm #=> 15

Returns:

  • (Integer)

    free throws made



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

attribute :ftm, Shale::Type::Integer

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



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

attribute :game_id, Shale::Type::String

#minString

Returns minutes played

Examples:

stat.min #=> "PT120M00.00S"

Returns:

  • (String)

    minutes played



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

attribute :min, Shale::Type::String

#orebInteger

Returns offensive rebounds

Examples:

stat.oreb #=> 8

Returns:

  • (Integer)

    offensive rebounds



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

attribute :oreb, Shale::Type::Integer

#pfInteger

Returns personal fouls

Examples:

stat.pf #=> 12

Returns:

  • (Integer)

    personal fouls



199
# File 'lib/nba/box_score_starter_bench_stat.rb', line 199

attribute :pf, Shale::Type::Integer

#plus_minusInteger

Returns plus/minus

Examples:

stat.plus_minus #=> 15

Returns:

  • (Integer)

    plus/minus



215
# File 'lib/nba/box_score_starter_bench_stat.rb', line 215

attribute :plus_minus, Shale::Type::Integer

#ptsInteger

Returns points

Examples:

stat.pts #=> 95

Returns:

  • (Integer)

    points



207
# File 'lib/nba/box_score_starter_bench_stat.rb', line 207

attribute :pts, Shale::Type::Integer

#rebInteger

Returns total rebounds

Examples:

stat.reb #=> 30

Returns:

  • (Integer)

    total rebounds



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

attribute :reb, Shale::Type::Integer

#starters_benchString

Returns whether this is starters or bench stats

Examples:

stat.starters_bench #=> "starters"

Returns:

  • (String)

    “starters” or “bench”



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

attribute :starters_bench, Shale::Type::String

#stlInteger

Returns steals

Examples:

stat.stl #=> 6

Returns:

  • (Integer)

    steals



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

attribute :stl, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • (String)

    the team city



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

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

stat.team_name #=> "Warriors"

Returns:

  • (String)

    the team name



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

attribute :team_name, Shale::Type::String

#tovInteger

Returns turnovers

Examples:

stat.tov #=> 10

Returns:

  • (Integer)

    turnovers



191
# File 'lib/nba/box_score_starter_bench_stat.rb', line 191

attribute :tov, Shale::Type::Integer

Instance Method Details

#bench?Boolean

Returns whether this is bench stats

Examples:

stat.bench? #=> true

Returns:

  • (Boolean)

    true if bench



233
234
235
# File 'lib/nba/box_score_starter_bench_stat.rb', line 233

def bench?
  starters_bench.eql?("bench")
end

#gameGame?

Returns the game object

Examples:

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

Returns:

  • (Game, nil)

    the game object



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

def game
  Games.find(game_id)
end

#starters?Boolean

Returns whether this is starter stats

Examples:

stat.starters? #=> true

Returns:

  • (Boolean)

    true if starters



223
224
225
# File 'lib/nba/box_score_starter_bench_stat.rb', line 223

def starters?
  starters_bench.eql?("starters")
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



243
244
245
# File 'lib/nba/box_score_starter_bench_stat.rb', line 243

def team
  Teams.find(team_id)
end