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


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>


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"


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"


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>


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"


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"


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


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>


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


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"


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"


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

attribute :full_name, Shale::Type::String

#genderString

Returns the player’s gender

Examples:

player.gender #=> "M"


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

attribute :gender, Shale::Type::String

#heightString

Returns the player’s height

Examples:

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


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


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


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


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"


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"


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"


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>


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>


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


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>


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"


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


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

attribute :weight, Shale::Type::Integer