Class: NBA::PlayerIndexEntry
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::PlayerIndexEntry
- Defined in:
- lib/nba/player_index_entry.rb
Overview
Represents a player from the player index endpoint
Instance Attribute Summary collapse
-
#ast ⇒ Float
Returns career assists per game.
-
#college ⇒ String
Returns the player’s college.
-
#country ⇒ String
Returns the player’s country.
-
#draft_number ⇒ Integer
Returns the player’s draft pick number.
-
#draft_round ⇒ Integer
Returns the player’s draft round.
-
#draft_year ⇒ Integer
Returns the player’s draft year.
-
#first_name ⇒ String
Returns the player’s first name.
-
#from_year ⇒ Integer
Returns the first year played.
-
#height ⇒ String
Returns the player’s height.
-
#id ⇒ Integer
Returns the player ID.
-
#is_defunct ⇒ Integer
Returns whether the player’s team is defunct.
-
#jersey_number ⇒ String
Returns the player’s jersey number.
-
#last_name ⇒ String
Returns the player’s last name.
-
#position ⇒ String
Returns the player’s position.
-
#pts ⇒ Float
Returns career points per game.
-
#reb ⇒ Float
Returns career rebounds per game.
-
#roster_status ⇒ Integer
Returns the player’s roster status.
-
#slug ⇒ String
Returns the player’s URL slug.
-
#stats_timeframe ⇒ String
Returns the stats timeframe.
-
#team_abbreviation ⇒ String
Returns the team’s abbreviation.
-
#team_city ⇒ String
Returns the team’s city.
-
#team_id ⇒ Integer
Returns the team ID.
-
#team_name ⇒ String
Returns the team’s name.
-
#team_slug ⇒ String
Returns the team’s URL slug.
-
#to_year ⇒ Integer
Returns the last year played.
-
#weight ⇒ Integer
Returns the player’s weight in pounds.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Returns whether the player is currently on a roster.
-
#defunct? ⇒ Boolean
Returns whether the player’s team is defunct.
-
#full_name ⇒ String
Returns the player’s full name.
-
#player ⇒ Player?
Returns the player object.
-
#team ⇒ Team?
Returns the team object.
Instance Attribute Details
#ast ⇒ Float
Returns career assists per game
182 |
# File 'lib/nba/player_index_entry.rb', line 182 attribute :ast, Shale::Type::Float |
#college ⇒ String
Returns the player’s college
118 |
# File 'lib/nba/player_index_entry.rb', line 118 attribute :college, Shale::Type::String |
#country ⇒ String
Returns the player’s country
126 |
# File 'lib/nba/player_index_entry.rb', line 126 attribute :country, Shale::Type::String |
#draft_number ⇒ Integer
Returns the player’s draft pick number
150 |
# File 'lib/nba/player_index_entry.rb', line 150 attribute :draft_number, Shale::Type::Integer |
#draft_round ⇒ Integer
Returns the player’s draft round
142 |
# File 'lib/nba/player_index_entry.rb', line 142 attribute :draft_round, Shale::Type::Integer |
#draft_year ⇒ Integer
Returns the player’s draft year
134 |
# File 'lib/nba/player_index_entry.rb', line 134 attribute :draft_year, Shale::Type::Integer |
#first_name ⇒ String
Returns the player’s first name
30 |
# File 'lib/nba/player_index_entry.rb', line 30 attribute :first_name, Shale::Type::String |
#from_year ⇒ Integer
Returns the first year played
198 |
# File 'lib/nba/player_index_entry.rb', line 198 attribute :from_year, Shale::Type::Integer |
#height ⇒ String
Returns the player’s height
102 |
# File 'lib/nba/player_index_entry.rb', line 102 attribute :height, Shale::Type::String |
#id ⇒ Integer
Returns the player ID
14 |
# File 'lib/nba/player_index_entry.rb', line 14 attribute :id, Shale::Type::Integer |
#is_defunct ⇒ Integer
Returns whether the player’s team is defunct
214 |
# File 'lib/nba/player_index_entry.rb', line 214 attribute :is_defunct, Shale::Type::Integer |
#jersey_number ⇒ String
Returns the player’s jersey number
86 |
# File 'lib/nba/player_index_entry.rb', line 86 attribute :jersey_number, Shale::Type::String |
#last_name ⇒ String
Returns the player’s last name
22 |
# File 'lib/nba/player_index_entry.rb', line 22 attribute :last_name, Shale::Type::String |
#position ⇒ String
Returns the player’s position
94 |
# File 'lib/nba/player_index_entry.rb', line 94 attribute :position, Shale::Type::String |
#pts ⇒ Float
Returns career points per game
166 |
# File 'lib/nba/player_index_entry.rb', line 166 attribute :pts, Shale::Type::Float |
#reb ⇒ Float
Returns career rebounds per game
174 |
# File 'lib/nba/player_index_entry.rb', line 174 attribute :reb, Shale::Type::Float |
#roster_status ⇒ Integer
Returns the player’s roster status
158 |
# File 'lib/nba/player_index_entry.rb', line 158 attribute :roster_status, Shale::Type::Integer |
#slug ⇒ String
Returns the player’s URL slug
38 |
# File 'lib/nba/player_index_entry.rb', line 38 attribute :slug, Shale::Type::String |
#stats_timeframe ⇒ String
Returns the stats timeframe
190 |
# File 'lib/nba/player_index_entry.rb', line 190 attribute :stats_timeframe, Shale::Type::String |
#team_abbreviation ⇒ String
Returns the team’s abbreviation
78 |
# File 'lib/nba/player_index_entry.rb', line 78 attribute :team_abbreviation, Shale::Type::String |
#team_city ⇒ String
Returns the team’s city
62 |
# File 'lib/nba/player_index_entry.rb', line 62 attribute :team_city, Shale::Type::String |
#team_id ⇒ Integer
Returns the team ID
46 |
# File 'lib/nba/player_index_entry.rb', line 46 attribute :team_id, Shale::Type::Integer |
#team_name ⇒ String
Returns the team’s name
70 |
# File 'lib/nba/player_index_entry.rb', line 70 attribute :team_name, Shale::Type::String |
#team_slug ⇒ String
Returns the team’s URL slug
54 |
# File 'lib/nba/player_index_entry.rb', line 54 attribute :team_slug, Shale::Type::String |
#to_year ⇒ Integer
Returns the last year played
206 |
# File 'lib/nba/player_index_entry.rb', line 206 attribute :to_year, Shale::Type::Integer |
#weight ⇒ Integer
Returns the player’s weight in pounds
110 |
# File 'lib/nba/player_index_entry.rb', line 110 attribute :weight, Shale::Type::Integer |
Instance Method Details
#active? ⇒ Boolean
Returns whether the player is currently on a roster
232 233 234 |
# File 'lib/nba/player_index_entry.rb', line 232 def active? roster_status.eql?(1) end |
#defunct? ⇒ Boolean
Returns whether the player’s team is defunct
242 243 244 |
# File 'lib/nba/player_index_entry.rb', line 242 def defunct? is_defunct.eql?(1) end |
#full_name ⇒ String
Returns the player’s full name
222 223 224 |
# File 'lib/nba/player_index_entry.rb', line 222 def full_name "#{first_name} #{last_name}".strip end |
#player ⇒ Player?
Returns the player object
252 253 254 |
# File 'lib/nba/player_index_entry.rb', line 252 def player Players.find(id) end |
#team ⇒ Team?
Returns the team object
262 263 264 |
# File 'lib/nba/player_index_entry.rb', line 262 def team Teams.find(team_id) end |