Class: MLB::Player

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/player.rb

Overview

Represents an MLB player with biographical and career information

Instance Attribute Summary collapse

Instance Attribute Details

#activeBoolean Also known as: active?

Returns whether the player is currently active

Examples:

player.active #=> true

Returns:

  • (Boolean)

    whether the player is currently active



122
# File 'lib/mlb/player.rb', line 122

attribute :active, Shale::Type::Boolean

#bat_sideHandedness

Returns the player’s batting side

Examples:

player.bat_side #=> #<MLB::Handedness>

Returns:



210
# File 'lib/mlb/player.rb', line 210

attribute :bat_side, Handedness

#birth_cityString

Returns the player’s birth city

Examples:

player.birth_city #=> "Oshu"

Returns:

  • (String)

    the player’s birth city



82
# File 'lib/mlb/player.rb', line 82

attribute :birth_city, Shale::Type::String

#birth_countryString

Returns the player’s birth country

Examples:

player.birth_country #=> "Japan"

Returns:

  • (String)

    the player’s birth country



98
# File 'lib/mlb/player.rb', line 98

attribute :birth_country, Shale::Type::String

#birth_dateDate

Returns the player’s date of birth

Examples:

player.birth_date #=> #<Date: 1994-07-05>

Returns:

  • (Date)

    the player’s date of birth



66
# File 'lib/mlb/player.rb', line 66

attribute :birth_date, Shale::Type::Date

#birth_state_provinceString

Returns the player’s birth state or province

Examples:

player.birth_state_province #=> "Iwate"

Returns:

  • (String)

    the player’s birth state or province



90
# File 'lib/mlb/player.rb', line 90

attribute :birth_state_province, Shale::Type::String

#boxscore_nameString

Returns the player’s name as displayed in boxscores

Examples:

player.boxscore_name #=> "Ohtani"

Returns:

  • (String)

    the player’s name as displayed in boxscores



162
# File 'lib/mlb/player.rb', line 162

attribute :boxscore_name, Shale::Type::String

#current_ageInteger

Returns the player’s current age

Examples:

player.current_age #=> 30

Returns:

  • (Integer)

    the player’s current age



74
# File 'lib/mlb/player.rb', line 74

attribute :current_age, Shale::Type::Integer

#current_teamTeam

Returns the player’s current team

Examples:

player.current_team #=> #<MLB::Team>

Returns:

  • (Team)

    the player’s current team



130
# File 'lib/mlb/player.rb', line 130

attribute :current_team, Team

#draft_yearInteger

Returns the year the player was drafted

Examples:

player.draft_year #=> 2018

Returns:

  • (Integer)

    the year the player was drafted



194
# File 'lib/mlb/player.rb', line 194

attribute :draft_year, Shale::Type::Integer

#first_nameString

Returns the player’s first name

Examples:

player.first_name #=> "Shohei"

Returns:

  • (String)

    the player’s first name



42
# File 'lib/mlb/player.rb', line 42

attribute :first_name, Shale::Type::String

#full_nameString

Returns the player’s full name

Examples:

player.full_name #=> "Shohei Ohtani"

Returns:

  • (String)

    the player’s full name



26
# File 'lib/mlb/player.rb', line 26

attribute :full_name, Shale::Type::String

#genderString

Returns the player’s gender

Examples:

player.gender #=> "M"

Returns:

  • (String)

    the player’s gender



170
# File 'lib/mlb/player.rb', line 170

attribute :gender, Shale::Type::String

#heightString

Returns the player’s height

Examples:

player.height #=> "6' 4\""

Returns:

  • (String)

    the player’s height



106
# File 'lib/mlb/player.rb', line 106

attribute :height, Shale::Type::String

#idInteger

Returns the unique identifier for the player

Examples:

player.id #=> 660271

Returns:

  • (Integer)

    the unique identifier for the player



18
# File 'lib/mlb/player.rb', line 18

attribute :id, Shale::Type::Integer

#is_playerBoolean Also known as: player?

Returns whether the person is a player

Examples:

player.is_player #=> true

Returns:

  • (Boolean)

    whether the person is a player



178
# File 'lib/mlb/player.rb', line 178

attribute :is_player, Shale::Type::Boolean

#is_verifiedBoolean Also known as: verified?

Returns whether the player’s information is verified

Examples:

player.is_verified #=> true

Returns:

  • (Boolean)

    whether the player’s information is verified



186
# File 'lib/mlb/player.rb', line 186

attribute :is_verified, Shale::Type::Boolean

#last_nameString

Returns the player’s last name

Examples:

player.last_name #=> "Ohtani"

Returns:

  • (String)

    the player’s last name



50
# File 'lib/mlb/player.rb', line 50

attribute :last_name, Shale::Type::String

Returns the API link for the player

Examples:

player.link #=> "/api/v1/people/660271"

Returns:

  • (String)

    the API link for the player



34
# File 'lib/mlb/player.rb', line 34

attribute :link, Shale::Type::String

#middle_nameString

Returns the player’s middle name

Examples:

player.middle_name #=> "James"

Returns:

  • (String)

    the player’s middle name



154
# File 'lib/mlb/player.rb', line 154

attribute :middle_name, Shale::Type::String

#mlb_debut_dateDate

Returns the date of the player’s MLB debut

Examples:

player.mlb_debut_date #=> #<Date: 2018-03-29>

Returns:

  • (Date)

    the date of the player’s MLB debut



202
# File 'lib/mlb/player.rb', line 202

attribute :mlb_debut_date, Shale::Type::Date

#pitch_handHandedness

Returns the player’s pitching hand

Examples:

player.pitch_hand #=> #<MLB::Handedness>

Returns:



218
# File 'lib/mlb/player.rb', line 218

attribute :pitch_hand, Handedness

#primary_numberInteger

Returns the player’s primary jersey number

Examples:

player.primary_number #=> 17

Returns:

  • (Integer)

    the player’s primary jersey number



58
# File 'lib/mlb/player.rb', line 58

attribute :primary_number, Shale::Type::Integer

#primary_positionPosition

Returns the player’s primary position

Examples:

player.primary_position #=> #<MLB::Position>

Returns:

  • (Position)

    the player’s primary position



138
# File 'lib/mlb/player.rb', line 138

attribute :primary_position, Position

#use_nameString

Returns the player’s preferred name

Examples:

player.use_name #=> "Shohei"

Returns:

  • (String)

    the player’s preferred name



146
# File 'lib/mlb/player.rb', line 146

attribute :use_name, Shale::Type::String

#weightInteger

Returns the player’s weight in pounds

Examples:

player.weight #=> 210

Returns:

  • (Integer)

    the player’s weight in pounds



114
# File 'lib/mlb/player.rb', line 114

attribute :weight, Shale::Type::Integer