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_team ⇒ String

Returns whether the player is active with the team

Examples:

player.active_with_team #=> "Y"

Returns:

  • (String) —

    the active status



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

attribute :active_with_team, Shale::Type::String

#ast ⇒ Float

Returns the assists

Examples:

player.ast #=> 6.5

Returns:

  • (Float) —

    the assists



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

attribute :ast, Shale::Type::Float

#blk ⇒ Float

Returns the blocks

Examples:

player.blk #=> 0.2

Returns:

  • (Float) —

    the blocks



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

attribute :blk, Shale::Type::Float

#dreb ⇒ Float

Returns the defensive rebounds

Examples:

player.dreb #=> 4.5

Returns:

  • (Float) —

    the defensive rebounds



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

attribute :dreb, Shale::Type::Float

#fg3_pct ⇒ Float

Returns the three-point field goal percentage

Examples:

player.fg3_pct #=> 0.426

Returns:

  • (Float) —

    the three-point field goal percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3a ⇒ Float

Returns the three-point field goals attempted

Examples:

player.fg3a #=> 11.2

Returns:

  • (Float) —

    the three-point field goals attempted



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

attribute :fg3a, Shale::Type::Float

#fg3m ⇒ Float

Returns the three-point field goals made

Examples:

player.fg3m #=> 4.5

Returns:

  • (Float) —

    the three-point field goals made



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

attribute :fg3m, Shale::Type::Float

#fg_pct ⇒ Float

Returns the field goal percentage

Examples:

player.fg_pct #=> 0.476

Returns:

  • (Float) —

    the field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fga ⇒ Float

Returns the field goals attempted

Examples:

player.fga #=> 19.3

Returns:

  • (Float) —

    the field goals attempted



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

attribute :fga, Shale::Type::Float

#fgm ⇒ Float

Returns the field goals made

Examples:

player.fgm #=> 9.2

Returns:

  • (Float) —

    the field goals made



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

attribute :fgm, Shale::Type::Float

#ft_pct ⇒ Float

Returns the free throw percentage

Examples:

player.ft_pct #=> 0.908

Returns:

  • (Float) —

    the free throw percentage



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

attribute :ft_pct, Shale::Type::Float

#fta ⇒ Float

Returns the free throws attempted

Examples:

player.fta #=> 5.3

Returns:

  • (Float) —

    the free throws attempted



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

attribute :fta, Shale::Type::Float

#ftm ⇒ Float

Returns the free throws made

Examples:

player.ftm #=> 4.8

Returns:

  • (Float) —

    the free throws made



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

attribute :ftm, Shale::Type::Float

#gp ⇒ Integer

Returns the games played

Examples:

player.gp #=> 745

Returns:

  • (Integer) —

    the games played



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

attribute :gp, Shale::Type::Integer

#league_id ⇒ String

Returns the league ID

Examples:

player.league_id #=> "00"

Returns:

  • (String) —

    the league ID



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

attribute :league_id, Shale::Type::String

#oreb ⇒ Float

Returns the offensive rebounds

Examples:

player.oreb #=> 0.5

Returns:

  • (Float) —

    the offensive rebounds



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

attribute :oreb, Shale::Type::Float

#person_id ⇒ Integer

Returns the player ID

Examples:

player.person_id #=> 201939

Returns:

  • (Integer) —

    the player ID



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

attribute :person_id, Shale::Type::Integer

#pf ⇒ Float

Returns the personal fouls

Examples:

player.pf #=> 2.1

Returns:

  • (Float) —

    the personal fouls



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

attribute :pf, Shale::Type::Float

#player ⇒ String

Returns the player name

Examples:

player.player #=> "Stephen Curry"

Returns:

  • (String) —

    the player name



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

attribute :player, Shale::Type::String

#pts ⇒ Float

Returns the points

Examples:

player.pts #=> 24.8

Returns:

  • (Float) —

    the points



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

attribute :pts, Shale::Type::Float

#reb ⇒ Float

Returns the total rebounds

Examples:

player.reb #=> 5.0

Returns:

  • (Float) —

    the total rebounds



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

attribute :reb, Shale::Type::Float

#season_type ⇒ String

Returns the season type

Examples:

player.season_type #=> "Regular Season"

Returns:

  • (String) —

    the season type



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

attribute :season_type, Shale::Type::String

#stl ⇒ Float

Returns the steals

Examples:

player.stl #=> 1.6

Returns:

  • (Float) —

    the steals



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

attribute :stl, Shale::Type::Float

#team ⇒ String

Returns the team name

Examples:

player.team #=> "Golden State Warriors"

Returns:

  • (String) —

    the team name



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

attribute :team, Shale::Type::String

#team_id ⇒ Integer

Returns the team ID

Examples:

player.team_id #=> 1610612744

Returns:

  • (Integer) —

    the team ID



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

attribute :team_id, Shale::Type::Integer

#tov ⇒ Float

Returns the turnovers

Examples:

player.tov #=> 3.1

Returns:

  • (Float) —

    the turnovers



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

attribute :tov, Shale::Type::Float

Instance Method Details

#player_info ⇒ Player?

Returns the player information

Examples:

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

Returns:

  • (Player, nil) —

    the player object



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

def player_info
  Players.find(person_id)
end