Class: NBA::BoxScoreDefensivePlayerStat

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

Overview

Represents defensive statistics for a player in a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blocksInteger

Returns blocks

Examples:

stat.blocks #=> 1

Returns:

  • (Integer)

    blocks



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

attribute :blocks, Shale::Type::Integer

#commentString

Returns any comment about the player

Examples:

stat.comment #=> "DNP - Rest"

Returns:

  • (String)

    the comment



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

attribute :comment, Shale::Type::String

#defensive_reboundsInteger

Returns defensive rebounds

Examples:

stat.defensive_rebounds #=> 5

Returns:

  • (Integer)

    defensive rebounds



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

attribute :defensive_rebounds, Shale::Type::Integer

#family_nameString

Returns the player family name

Examples:

stat.family_name #=> "Curry"

Returns:

  • (String)

    the family name



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

attribute :family_name, Shale::Type::String

#first_nameString

Returns the player first name

Examples:

stat.first_name #=> "Stephen"

Returns:

  • (String)

    the first name



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

attribute :first_name, Shale::Type::String

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



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

attribute :game_id, Shale::Type::String

#jersey_numString

Returns the jersey number

Examples:

stat.jersey_num #=> "30"

Returns:

  • (String)

    the jersey number



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

attribute :jersey_num, Shale::Type::String

#matchup_assistsInteger

Returns matchup assists

Examples:

stat.matchup_assists #=> 3

Returns:

  • (Integer)

    matchup assists



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

attribute :matchup_assists, Shale::Type::Integer

#matchup_field_goal_percentageFloat

Returns matchup field goal percentage

Examples:

stat.matchup_field_goal_percentage #=> 0.417

Returns:

  • (Float)

    matchup field goal percentage



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

attribute :matchup_field_goal_percentage, Shale::Type::Float

#matchup_field_goals_attemptedInteger

Returns matchup field goals attempted

Examples:

stat.matchup_field_goals_attempted #=> 12

Returns:

  • (Integer)

    matchup field goals attempted



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

attribute :matchup_field_goals_attempted, Shale::Type::Integer

#matchup_field_goals_madeInteger

Returns matchup field goals made

Examples:

stat.matchup_field_goals_made #=> 5

Returns:

  • (Integer)

    matchup field goals made



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

attribute :matchup_field_goals_made, Shale::Type::Integer

#matchup_minutesFloat

Returns the matchup minutes

Examples:

stat.matchup_minutes #=> 24.5

Returns:

  • (Float)

    the matchup minutes



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

attribute :matchup_minutes, Shale::Type::Float

#matchup_three_pointer_percentageFloat

Returns matchup three pointer percentage

Examples:

stat.matchup_three_pointer_percentage #=> 0.4

Returns:

  • (Float)

    matchup three pointer percentage



239
# File 'lib/nba/box_score_defensive_player_stat.rb', line 239

attribute :matchup_three_pointer_percentage, Shale::Type::Float

#matchup_three_pointers_attemptedInteger

Returns matchup three pointers attempted

Examples:

stat.matchup_three_pointers_attempted #=> 5

Returns:

  • (Integer)

    matchup three pointers attempted



231
# File 'lib/nba/box_score_defensive_player_stat.rb', line 231

attribute :matchup_three_pointers_attempted, Shale::Type::Integer

#matchup_three_pointers_madeInteger

Returns matchup three pointers made

Examples:

stat.matchup_three_pointers_made #=> 2

Returns:

  • (Integer)

    matchup three pointers made



223
# File 'lib/nba/box_score_defensive_player_stat.rb', line 223

attribute :matchup_three_pointers_made, Shale::Type::Integer

#matchup_turnoversInteger

Returns matchup turnovers

Examples:

stat.matchup_turnovers #=> 2

Returns:

  • (Integer)

    matchup turnovers



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

attribute :matchup_turnovers, Shale::Type::Integer

#name_iString

Returns the player name initial format

Examples:

stat.name_i #=> "S. Curry"

Returns:

  • (String)

    the name initial format



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

attribute :name_i, Shale::Type::String

#partial_possessionsFloat

Returns partial possessions

Examples:

stat.partial_possessions #=> 15.2

Returns:

  • (Float)

    partial possessions



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

attribute :partial_possessions, Shale::Type::Float

#person_idInteger

Returns the person ID

Examples:

stat.person_id #=> 201939

Returns:

  • (Integer)

    the person ID



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

attribute :person_id, Shale::Type::Integer

#player_pointsInteger

Returns points allowed

Examples:

stat.player_points #=> 12

Returns:

  • (Integer)

    player points allowed



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

attribute :player_points, Shale::Type::Integer

#player_slugString

Returns the player slug

Examples:

stat.player_slug #=> "stephen-curry"

Returns:

  • (String)

    the player slug



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

attribute :player_slug, Shale::Type::String

#positionString

Returns the player position

Examples:

stat.position #=> "G"

Returns:

  • (String)

    the position



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

attribute :position, Shale::Type::String

#stealsInteger

Returns steals

Examples:

stat.steals #=> 2

Returns:

  • (Integer)

    steals



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

attribute :steals, Shale::Type::Integer

#switches_onInteger

Returns number of switches on

Examples:

stat.switches_on #=> 8

Returns:

  • (Integer)

    switches on



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

attribute :switches_on, Shale::Type::Integer

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • (String)

    the team city



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

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_defensive_player_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



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

attribute :team_name, Shale::Type::String

#team_slugString

Returns the team slug

Examples:

stat.team_slug #=> "warriors"

Returns:

  • (String)

    the team slug



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

attribute :team_slug, Shale::Type::String

#team_tricodeString

Returns the team tricode

Examples:

stat.team_tricode #=> "GSW"

Returns:

  • (String)

    the team tricode



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

attribute :team_tricode, Shale::Type::String

Instance Method Details

#gameGame?

Returns the game object

Examples:

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

Returns:

  • (Game, nil)

    the game object



267
268
269
# File 'lib/nba/box_score_defensive_player_stat.rb', line 267

def game
  Games.find(game_id)
end

#playerPlayer?

Returns the player object

Examples:

stat.player #=> #<NBA::Player>

Returns:

  • (Player, nil)

    the player object



247
248
249
# File 'lib/nba/box_score_defensive_player_stat.rb', line 247

def player
  Players.find(person_id)
end

#starter?Boolean

Returns whether the player started

Examples:

stat.starter? #=> true

Returns:

  • (Boolean)

    true if starter



277
278
279
# File 'lib/nba/box_score_defensive_player_stat.rb', line 277

def starter?
  !position.nil? && !position.empty?
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



257
258
259
# File 'lib/nba/box_score_defensive_player_stat.rb', line 257

def team
  Teams.find(team_id)
end