Class: NBA::FranchisePlayer

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

Overview

Represents a player’s franchise statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#active_with_teamString

Returns whether the player is active with the team

Examples:

player.active_with_team #=> "Y"


60
# File 'lib/nba/franchise_player.rb', line 60

attribute :active_with_team, Shale::Type::String

#astFloat

Returns the assists

Examples:

player.ast #=> 6.5


172
# File 'lib/nba/franchise_player.rb', line 172

attribute :ast, Shale::Type::Float

#blkFloat

Returns the blocks

Examples:

player.blk #=> 0.2


204
# File 'lib/nba/franchise_player.rb', line 204

attribute :blk, Shale::Type::Float

#drebFloat

Returns the defensive rebounds

Examples:

player.dreb #=> 4.5


156
# File 'lib/nba/franchise_player.rb', line 156

attribute :dreb, Shale::Type::Float

#fg3_pctFloat

Returns the three-point field goal percentage

Examples:

player.fg3_pct #=> 0.426


116
# File 'lib/nba/franchise_player.rb', line 116

attribute :fg3_pct, Shale::Type::Float

#fg3aFloat

Returns the three-point field goals attempted

Examples:

player.fg3a #=> 11.2


108
# File 'lib/nba/franchise_player.rb', line 108

attribute :fg3a, Shale::Type::Float

#fg3mFloat

Returns the three-point field goals made

Examples:

player.fg3m #=> 4.5


100
# File 'lib/nba/franchise_player.rb', line 100

attribute :fg3m, Shale::Type::Float

#fg_pctFloat

Returns the field goal percentage

Examples:

player.fg_pct #=> 0.476


92
# File 'lib/nba/franchise_player.rb', line 92

attribute :fg_pct, Shale::Type::Float

#fgaFloat

Returns the field goals attempted

Examples:

player.fga #=> 19.3


84
# File 'lib/nba/franchise_player.rb', line 84

attribute :fga, Shale::Type::Float

#fgmFloat

Returns the field goals made

Examples:

player.fgm #=> 9.2


76
# File 'lib/nba/franchise_player.rb', line 76

attribute :fgm, Shale::Type::Float

#ft_pctFloat

Returns the free throw percentage

Examples:

player.ft_pct #=> 0.908


140
# File 'lib/nba/franchise_player.rb', line 140

attribute :ft_pct, Shale::Type::Float

#ftaFloat

Returns the free throws attempted

Examples:

player.fta #=> 5.3


132
# File 'lib/nba/franchise_player.rb', line 132

attribute :fta, Shale::Type::Float

#ftmFloat

Returns the free throws made

Examples:

player.ftm #=> 4.8


124
# File 'lib/nba/franchise_player.rb', line 124

attribute :ftm, Shale::Type::Float

#gpInteger

Returns the games played

Examples:

player.gp #=> 745


68
# File 'lib/nba/franchise_player.rb', line 68

attribute :gp, Shale::Type::Integer

#league_idString

Returns the league ID

Examples:

player.league_id #=> "00"


12
# File 'lib/nba/franchise_player.rb', line 12

attribute :league_id, Shale::Type::String

#orebFloat

Returns the offensive rebounds

Examples:

player.oreb #=> 0.5


148
# File 'lib/nba/franchise_player.rb', line 148

attribute :oreb, Shale::Type::Float

#person_idInteger

Returns the player ID

Examples:

player.person_id #=> 201939


36
# File 'lib/nba/franchise_player.rb', line 36

attribute :person_id, Shale::Type::Integer

#pfFloat

Returns the personal fouls

Examples:

player.pf #=> 2.1


180
# File 'lib/nba/franchise_player.rb', line 180

attribute :pf, Shale::Type::Float

#playerString

Returns the player name

Examples:

player.player #=> "Stephen Curry"


44
# File 'lib/nba/franchise_player.rb', line 44

attribute :player, Shale::Type::String

#ptsFloat

Returns the points

Examples:

player.pts #=> 24.8


212
# File 'lib/nba/franchise_player.rb', line 212

attribute :pts, Shale::Type::Float

#rebFloat

Returns the total rebounds

Examples:

player.reb #=> 5.0


164
# File 'lib/nba/franchise_player.rb', line 164

attribute :reb, Shale::Type::Float

#season_typeString

Returns the season type

Examples:

player.season_type #=> "Regular Season"


52
# File 'lib/nba/franchise_player.rb', line 52

attribute :season_type, Shale::Type::String

#stlFloat

Returns the steals

Examples:

player.stl #=> 1.6


188
# File 'lib/nba/franchise_player.rb', line 188

attribute :stl, Shale::Type::Float

#teamString

Returns the team name

Examples:

player.team #=> "Golden State Warriors"


28
# File 'lib/nba/franchise_player.rb', line 28

attribute :team, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

player.team_id #=> 1610612744


20
# File 'lib/nba/franchise_player.rb', line 20

attribute :team_id, Shale::Type::Integer

#tovFloat

Returns the turnovers

Examples:

player.tov #=> 3.1


196
# File 'lib/nba/franchise_player.rb', line 196

attribute :tov, Shale::Type::Float

Instance Method Details

#player_infoPlayer?

Returns the player information

Examples:

franchise_player.player_info #=> #<NBA::Player>


220
221
222
# File 'lib/nba/franchise_player.rb', line 220

def player_info
  Players.find(person_id)
end