Class: MLB::ScheduleDate

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

Overview

Represents a date within a schedule response

Instance Attribute Summary collapse

Instance Attribute Details

#dateDate

Returns the date

Examples:

schedule_date.date #=> #<Date: 2024-07-04>

Returns:

  • (Date)

    the date



13
# File 'lib/mlb/schedule_date.rb', line 13

attribute :date, Shale::Type::Date

#gamesArray<ScheduledGame>

Returns the games scheduled for this date

Examples:

schedule_date.games #=> [#<MLB::ScheduledGame>, ...]

Returns:



29
# File 'lib/mlb/schedule_date.rb', line 29

attribute :games, ScheduledGame, collection: true

#total_gamesInteger

Returns the total number of games on this date

Examples:

schedule_date.total_games #=> 15

Returns:

  • (Integer)

    the total number of games



21
# File 'lib/mlb/schedule_date.rb', line 21

attribute :total_games, Shale::Type::Integer