module MLBStatsAPI::Standings

Operations pertaining to standings @see statsapi.mlb.com/docs/#tag/standings

Public Instance Methods

standings(options = {}) click to toggle source

View standings for a league. @see statsapi.mlb.com/docs/#operation/standings

# File lib/mlb_stats_api/standings.rb, line 9
def standings(options = {})
  options[:hydrate] = 'team' unless options.key?(:hydrate)

  if options[:leagues] && !options[:leagueId]
    league_ids = Leagues::LEAGUES.values_at(*options.delete(:leagues))

    options[:leagueId] = league_ids
  end

  options[:leagueId] = [103, 104] unless Array(options[:leagueId])&.any?

  get '/standings', options
end