Class: MLB::TiedGames
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::TiedGames
- Defined in:
- lib/mlb/tied_games.rb
Overview
Provides methods for fetching tied games from the API
Instance Attribute Summary collapse
-
#dates ⇒ Array<ScheduleDate>
Returns the schedule dates with tied games.
Class Method Summary collapse
-
.all(season: nil) ⇒ Array<ScheduledGame>
Retrieves tied games for a given season.
Instance Attribute Details
#dates ⇒ Array<ScheduleDate>
Returns the schedule dates with tied games
13 |
# File 'lib/mlb/tied_games.rb', line 13 attribute :dates, ScheduleDate, collection: true |
Class Method Details
.all(season: nil) ⇒ Array<ScheduledGame>
Retrieves tied games for a given season
26 27 28 29 30 |
# File 'lib/mlb/tied_games.rb', line 26 def self.all(season: nil) season ||= Utils.current_season response = CLIENT.get("schedule/games/tied?#{Utils.build_query(season:)}") from_json(response).dates.flat_map(&:games) end |