Class: MLB::PlayerStat

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

Overview

Represents a player stat split

Instance Attribute Summary collapse

Instance Attribute Details

#player ⇒ Player

Returns the player

Examples:

player_stat.player.name #=> "Aaron Judge"

Returns:



35
# File 'lib/mlb/player_stat.rb', line 35

attribute :player, Player

#position ⇒ Position

Returns the player's position

Examples:

player_stat.position.abbreviation #=> "RF"

Returns:



59
# File 'lib/mlb/player_stat.rb', line 59

attribute :position, Position

#rank ⇒ Integer

Returns the rank in the stat leaderboard

Examples:

player_stat.rank #=> 1

Returns:

  • (Integer) —

    the rank



51
# File 'lib/mlb/player_stat.rb', line 51

attribute :rank, Shale::Type::Integer

#season ⇒ String

Returns the season for this stat split

Examples:

player_stat.season #=> "2024"

Returns:

  • (String) —

    the season



19
# File 'lib/mlb/player_stat.rb', line 19

attribute :season, Shale::Type::String

#stat ⇒ StatValues

Returns the stat values

Examples:

player_stat.stat.home_runs #=> 54

Returns:



27
# File 'lib/mlb/player_stat.rb', line 27

attribute :stat, StatValues

#team ⇒ Team

Returns the team

Examples:

player_stat.team.name #=> "New York Yankees"

Returns:

  • (Team) —

    the team



43
# File 'lib/mlb/player_stat.rb', line 43

attribute :team, Team