Class: MLB::HighLowResult

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

Overview

Represents a high/low stat result

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateString

Returns the date

Examples:

result.date #=> "2024-06-06"

Returns:

  • (String)

    the date



40
# File 'lib/mlb/high_low.rb', line 40

attribute :date, Shale::Type::String

#is_homeBoolean

Returns whether the team was at home

Examples:

result.home? #=> false

Returns:

  • (Boolean)

    whether at home



48
# File 'lib/mlb/high_low.rb', line 48

attribute :is_home, Shale::Type::Boolean

#opponentTeam

Returns the opponent team

Examples:

result.opponent #=> #<MLB::Team>

Returns:

  • (Team)

    the opponent



32
# File 'lib/mlb/high_low.rb', line 32

attribute :opponent, Team

#rankInteger

Returns the rank

Examples:

result.rank #=> 1

Returns:

  • (Integer)

    the rank



56
# File 'lib/mlb/high_low.rb', line 56

attribute :rank, Shale::Type::Integer

#seasonString

Returns the season

Examples:

result.season #=> "2024"

Returns:

  • (String)

    the season



16
# File 'lib/mlb/high_low.rb', line 16

attribute :season, Shale::Type::String

#teamTeam

Returns the team

Examples:

result.team #=> #<MLB::Team>

Returns:

  • (Team)

    the team



24
# File 'lib/mlb/high_low.rb', line 24

attribute :team, Team

Instance Method Details

#home?Boolean

Returns whether the team was at home

Examples:

result.home? #=> false

Returns:

  • (Boolean)

    whether at home



64
65
66
# File 'lib/mlb/high_low.rb', line 64

def home?
  is_home
end