Class: NBA::BoxScoreHustlePlayerStat

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

Overview

Represents hustle statistics for a player in a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#box_outsInteger

Returns box outs

Examples:

stat.box_outs #=> 3

Returns:

  • (Integer)

    box outs



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

attribute :box_outs, Shale::Type::Integer

#charges_drawnInteger

Returns charges drawn

Examples:

stat.charges_drawn #=> 1

Returns:

  • (Integer)

    charges drawn



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

attribute :charges_drawn, Shale::Type::Integer

#commentString

Returns any comment about the player

Examples:

stat.comment #=> "DNP - Rest"

Returns:

  • (String)

    the comment



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

attribute :comment, Shale::Type::String

#contested_shotsInteger

Returns contested shots

Examples:

stat.contested_shots #=> 8

Returns:

  • (Integer)

    contested shots



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

attribute :contested_shots, Shale::Type::Integer

#contested_shots_2ptInteger

Returns contested 2-point shots

Examples:

stat.contested_shots_2pt #=> 5

Returns:

  • (Integer)

    contested 2-point shots



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

attribute :contested_shots_2pt, Shale::Type::Integer

#contested_shots_3ptInteger

Returns contested 3-point shots

Examples:

stat.contested_shots_3pt #=> 3

Returns:

  • (Integer)

    contested 3-point shots



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

attribute :contested_shots_3pt, Shale::Type::Integer

#def_box_outsInteger

Returns defensive box outs

Examples:

stat.def_box_outs #=> 2

Returns:

  • (Integer)

    defensive box outs



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

attribute :def_box_outs, Shale::Type::Integer

#def_loose_balls_recoveredInteger

Returns defensive loose balls recovered

Examples:

stat.def_loose_balls_recovered #=> 1

Returns:

  • (Integer)

    defensive loose balls recovered



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

attribute :def_loose_balls_recovered, Shale::Type::Integer

#deflectionsInteger

Returns deflections

Examples:

stat.deflections #=> 4

Returns:

  • (Integer)

    deflections



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

attribute :deflections, 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_hustle_player_stat.rb', line 15

attribute :game_id, Shale::Type::String

#loose_balls_recoveredInteger

Returns loose balls recovered

Examples:

stat.loose_balls_recovered #=> 2

Returns:

  • (Integer)

    loose balls recovered



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

attribute :loose_balls_recovered, Shale::Type::Integer

#minString

Returns minutes played

Examples:

stat.min #=> "32:45"

Returns:

  • (String)

    the minutes



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

attribute :min, Shale::Type::String

#off_box_outsInteger

Returns offensive box outs

Examples:

stat.off_box_outs #=> 1

Returns:

  • (Integer)

    offensive box outs



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

attribute :off_box_outs, Shale::Type::Integer

#off_loose_balls_recoveredInteger

Returns offensive loose balls recovered

Examples:

stat.off_loose_balls_recovered #=> 1

Returns:

  • (Integer)

    offensive loose balls recovered



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

attribute :off_loose_balls_recovered, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer)

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String)

    the player name



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

attribute :player_name, Shale::Type::String

#ptsInteger

Returns points scored

Examples:

stat.pts #=> 28

Returns:

  • (Integer)

    points



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

attribute :pts, Shale::Type::Integer

#screen_assistsInteger

Returns screen assists

Examples:

stat.screen_assists #=> 3

Returns:

  • (Integer)

    screen assists



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

attribute :screen_assists, Shale::Type::Integer

#screen_ast_ptsInteger

Returns points from screen assists

Examples:

stat.screen_ast_pts #=> 6

Returns:

  • (Integer)

    screen assist points



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

attribute :screen_ast_pts, Shale::Type::Integer

#start_positionString

Returns the starting position

Examples:

stat.start_position #=> "G"

Returns:

  • (String)

    the starting position



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

attribute :start_position, Shale::Type::String

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • (String)

    the team city



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

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_hustle_player_stat.rb', line 23

attribute :team_id, Shale::Type::Integer

Instance Method Details

#gameGame?

Returns the game object

Examples:

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

Returns:

  • (Game, nil)

    the game object



219
220
221
# File 'lib/nba/box_score_hustle_player_stat.rb', line 219

def game
  Games.find(game_id)
end

#playerPlayer?

Returns the player object

Examples:

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

Returns:

  • (Player, nil)

    the player object



199
200
201
# File 'lib/nba/box_score_hustle_player_stat.rb', line 199

def player
  Players.find(player_id)
end

#starter?Boolean

Returns whether the player started

Examples:

stat.starter? #=> true

Returns:

  • (Boolean)

    true if starter



229
230
231
# File 'lib/nba/box_score_hustle_player_stat.rb', line 229

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

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



209
210
211
# File 'lib/nba/box_score_hustle_player_stat.rb', line 209

def team
  Teams.find(team_id)
end