Class: MLB::StandingsRecord

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

Overview

Represents a standings record for a division

Constant Summary collapse

STANDINGS_REGULAR_SEASON =
"regularSeason".freeze
STANDINGS_WILD_CARD =
"wildCard".freeze
STANDINGS_DIVISION_LEADERS =
"divisionLeaders".freeze
STANDINGS_WILD_CARD_WITH_LEADERS =
"wildCardWithLeaders".freeze
STANDINGS_FIRST_HALF =
"firstHalf".freeze
STANDINGS_SECOND_HALF =
"secondHalf".freeze
STANDINGS_SPRING_TRAINING =
"springTraining".freeze
STANDINGS_POSTSEASON =
"postseason".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#divisionDivision

Returns the division

Examples:

standings_record.division #=> #<MLB::Division>

Returns:



41
# File 'lib/mlb/standings_record.rb', line 41

attribute :division, Division

#last_updatedString

Returns when the standings were last updated

Examples:

standings_record.last_updated #=> "2024-09-23T02:30:10.088Z"

Returns:

  • (String)

    when the standings were last updated



57
# File 'lib/mlb/standings_record.rb', line 57

attribute :last_updated, Shale::Type::String

#leagueLeague

Returns the league

Examples:

standings_record.league #=> #<MLB::League>

Returns:



33
# File 'lib/mlb/standings_record.rb', line 33

attribute :league, League

#sportSport

Returns the sport

Examples:

standings_record.sport #=> #<MLB::Sport>

Returns:



49
# File 'lib/mlb/standings_record.rb', line 49

attribute :sport, Sport

#standings_typeString

Returns the standings type

Examples:

standings_record.standings_type #=> "regularSeason"

Returns:

  • (String)

    the standings type



25
# File 'lib/mlb/standings_record.rb', line 25

attribute :standings_type, Shale::Type::String

#team_recordsArray<TeamRecord>

Returns the team records

Examples:

standings_record.team_records #=> [#<MLB::TeamRecord>, ...]

Returns:



65
# File 'lib/mlb/standings_record.rb', line 65

attribute :team_records, TeamRecord, collection: true

Instance Method Details

#postseason?Boolean

Returns whether this is postseason standings

Examples:

standings_record.postseason? #=> false

Returns:

  • (Boolean)

    whether this is postseason standings



97
# File 'lib/mlb/standings_record.rb', line 97

def postseason? = standings_type.eql?(STANDINGS_POSTSEASON)

#regular_season?Boolean

Returns whether this is regular season standings

Examples:

standings_record.regular_season? #=> true

Returns:

  • (Boolean)

    whether this is regular season standings



73
# File 'lib/mlb/standings_record.rb', line 73

def regular_season? = standings_type.eql?(STANDINGS_REGULAR_SEASON)

#spring_training?Boolean

Returns whether this is spring training standings

Examples:

standings_record.spring_training? #=> false

Returns:

  • (Boolean)

    whether this is spring training standings



89
# File 'lib/mlb/standings_record.rb', line 89

def spring_training? = standings_type.eql?(STANDINGS_SPRING_TRAINING)

#wild_card?Boolean

Returns whether this is wild card standings

Examples:

standings_record.wild_card? #=> false

Returns:

  • (Boolean)

    whether this is wild card standings



81
# File 'lib/mlb/standings_record.rb', line 81

def wild_card? = standings_type.eql?(STANDINGS_WILD_CARD)