Class: NBA::LeagueDashPlayerBioStat

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

Overview

Represents league-wide player biographical statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageFloat?

Returns the player’s age

Examples:

stat.age #=> 36

Returns:

  • (Float, nil)

    the player’s age



51
# File 'lib/nba/league_dash_player_bio_stat.rb', line 51

attribute :age, Shale::Type::Float

#astFloat?

Returns assists per game

Examples:

stat.ast #=> 6.1

Returns:

  • (Float, nil)

    assists per game



147
# File 'lib/nba/league_dash_player_bio_stat.rb', line 147

attribute :ast, Shale::Type::Float

#ast_pctFloat?

Returns assist percentage

Examples:

stat.ast_pct #=> 0.312

Returns:

  • (Float, nil)

    assist percentage



195
# File 'lib/nba/league_dash_player_bio_stat.rb', line 195

attribute :ast_pct, Shale::Type::Float

#collegeString?

Returns the player’s college

Examples:

stat.college #=> "Davidson"

Returns:

  • (String, nil)

    the player’s college



83
# File 'lib/nba/league_dash_player_bio_stat.rb', line 83

attribute :college, Shale::Type::String

#countryString?

Returns the player’s country

Examples:

stat.country #=> "USA"

Returns:

  • (String, nil)

    the player’s country



91
# File 'lib/nba/league_dash_player_bio_stat.rb', line 91

attribute :country, Shale::Type::String

#draft_numberString?

Returns the player’s draft number

Examples:

stat.draft_number #=> "7"

Returns:

  • (String, nil)

    the player’s draft number



115
# File 'lib/nba/league_dash_player_bio_stat.rb', line 115

attribute :draft_number, Shale::Type::String

#draft_roundString?

Returns the player’s draft round

Examples:

stat.draft_round #=> "1"

Returns:

  • (String, nil)

    the player’s draft round



107
# File 'lib/nba/league_dash_player_bio_stat.rb', line 107

attribute :draft_round, Shale::Type::String

#draft_yearString?

Returns the player’s draft year

Examples:

stat.draft_year #=> "2009"

Returns:

  • (String, nil)

    the player’s draft year



99
# File 'lib/nba/league_dash_player_bio_stat.rb', line 99

attribute :draft_year, Shale::Type::String

#dreb_pctFloat?

Returns defensive rebound percentage

Examples:

stat.dreb_pct #=> 0.112

Returns:

  • (Float, nil)

    defensive rebound percentage



171
# File 'lib/nba/league_dash_player_bio_stat.rb', line 171

attribute :dreb_pct, Shale::Type::Float

#gpInteger?

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer, nil)

    games played



123
# File 'lib/nba/league_dash_player_bio_stat.rb', line 123

attribute :gp, Shale::Type::Integer

#net_ratingFloat?

Returns net rating

Examples:

stat.net_rating #=> 8.5

Returns:

  • (Float, nil)

    net rating



155
# File 'lib/nba/league_dash_player_bio_stat.rb', line 155

attribute :net_rating, Shale::Type::Float

#oreb_pctFloat?

Returns offensive rebound percentage

Examples:

stat.oreb_pct #=> 0.025

Returns:

  • (Float, nil)

    offensive rebound percentage



163
# File 'lib/nba/league_dash_player_bio_stat.rb', line 163

attribute :oreb_pct, Shale::Type::Float

#player_heightString?

Returns the player’s height as a formatted string

Examples:

stat.player_height #=> "6-2"

Returns:

  • (String, nil)

    the player’s height



59
# File 'lib/nba/league_dash_player_bio_stat.rb', line 59

attribute :player_height, Shale::Type::String

#player_height_inchesInteger?

Returns the player’s height in inches

Examples:

stat.player_height_inches #=> 74

Returns:

  • (Integer, nil)

    the player’s height in inches



67
# File 'lib/nba/league_dash_player_bio_stat.rb', line 67

attribute :player_height_inches, Shale::Type::Integer

#player_idInteger?

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer, nil)

    the player’s ID



19
# File 'lib/nba/league_dash_player_bio_stat.rb', line 19

attribute :player_id, Shale::Type::Integer

#player_nameString?

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String, nil)

    the player’s name



27
# File 'lib/nba/league_dash_player_bio_stat.rb', line 27

attribute :player_name, Shale::Type::String

#player_weightInteger?

Returns the player’s weight in pounds

Examples:

stat.player_weight #=> 185

Returns:

  • (Integer, nil)

    the player’s weight



75
# File 'lib/nba/league_dash_player_bio_stat.rb', line 75

attribute :player_weight, Shale::Type::Integer

#ptsFloat?

Returns points per game

Examples:

stat.pts #=> 26.4

Returns:

  • (Float, nil)

    points per game



131
# File 'lib/nba/league_dash_player_bio_stat.rb', line 131

attribute :pts, Shale::Type::Float

#rebFloat?

Returns rebounds per game

Examples:

stat.reb #=> 5.2

Returns:

  • (Float, nil)

    rebounds per game



139
# File 'lib/nba/league_dash_player_bio_stat.rb', line 139

attribute :reb, Shale::Type::Float

#team_abbreviationString?

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team’s abbreviation



43
# File 'lib/nba/league_dash_player_bio_stat.rb', line 43

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team’s ID



35
# File 'lib/nba/league_dash_player_bio_stat.rb', line 35

attribute :team_id, Shale::Type::Integer

#ts_pctFloat?

Returns true shooting percentage

Examples:

stat.ts_pct #=> 0.621

Returns:

  • (Float, nil)

    true shooting percentage



187
# File 'lib/nba/league_dash_player_bio_stat.rb', line 187

attribute :ts_pct, Shale::Type::Float

#usg_pctFloat?

Returns usage percentage

Examples:

stat.usg_pct #=> 0.298

Returns:

  • (Float, nil)

    usage percentage



179
# File 'lib/nba/league_dash_player_bio_stat.rb', line 179

attribute :usg_pct, Shale::Type::Float

Instance Method Details

#playerPlayer?

Returns the player

Examples:

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

Returns:

  • (Player, nil)

    the player object



203
204
205
# File 'lib/nba/league_dash_player_bio_stat.rb', line 203

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team

Examples:

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

Returns:

  • (Team, nil)

    the team object



213
214
215
# File 'lib/nba/league_dash_player_bio_stat.rb', line 213

def team
  Teams.find(team_id)
end