Class: NBA::DraftPick

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

Overview

Represents a draft pick

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collegeString

Returns the player’s college

Examples:

pick.college #=> "France"

Returns:

  • (String)

    the college



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

attribute :college, Shale::Type::String

#countryString

Returns the player’s country

Examples:

pick.country #=> "France"

Returns:

  • (String)

    the country



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

attribute :country, Shale::Type::String

#draft_typeString

Returns the draft type

Examples:

pick.draft_type #=> "Draft"

Returns:

  • (String)

    the draft type



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

attribute :draft_type, Shale::Type::String

#heightString

Returns the player’s height

Examples:

pick.height #=> "7-4"

Returns:

  • (String)

    the height



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

attribute :height, Shale::Type::String

#overall_pickInteger

Returns the overall pick number

Examples:

pick.overall_pick #=> 1

Returns:

  • (Integer)

    the overall pick



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

attribute :overall_pick, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

pick.player_id #=> 1630162

Returns:

  • (Integer)

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

pick.player_name #=> "Victor Wembanyama"

Returns:

  • (String)

    the player name



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

attribute :player_name, Shale::Type::String

#positionString

Returns the player’s position

Examples:

pick.position #=> "C"

Returns:

  • (String)

    the position



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

attribute :position, Shale::Type::String

#round_numberInteger

Returns the round number

Examples:

pick.round_number #=> 1

Returns:

  • (Integer)

    the round number



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

attribute :round_number, Shale::Type::Integer

#round_pickInteger

Returns the pick number within the round

Examples:

pick.round_pick #=> 1

Returns:

  • (Integer)

    the round pick



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

attribute :round_pick, Shale::Type::Integer

#seasonInteger

Returns the draft season/year

Examples:

pick.season #=> 2023

Returns:

  • (Integer)

    the season



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

attribute :season, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

pick.team_abbreviation #=> "SAS"

Returns:

  • (String)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

pick.team_city #=> "San Antonio"

Returns:

  • (String)

    the team city



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

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID that drafted the player

Examples:

pick.team_id #=> 1610612759

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

pick.team_name #=> "Spurs"

Returns:

  • (String)

    the team name



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

attribute :team_name, Shale::Type::String

#weightInteger

Returns the player’s weight

Examples:

pick.weight #=> 210

Returns:

  • (Integer)

    the weight



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

attribute :weight, Shale::Type::Integer

Instance Method Details

#playerPlayer?

Returns the player object

Examples:

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

Returns:

  • (Player, nil)

    the player object



140
141
142
# File 'lib/nba/draft_pick.rb', line 140

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



150
151
152
# File 'lib/nba/draft_pick.rb', line 150

def team
  Teams.find(team_id)
end