Sha256: 5133ec3ff91d52cf5d1965ae6ed7f442bd0037a61974d2d2f4c61ee9fed2dac1

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module MLBStatsAPI
  module Schedules
    SCHEDULE_TYPES = {
      default: '/schedule',
      postseason: '/schedule/postseason',
      tied: '/schedule/games/tied',
      postseason_series: '/schedule/postseason/series',
      tune_in: '/schedule/postseason/tuneIn'
    }.freeze

    def schedule(type = :default, options = {})
      if type.is_a?(Hash) && options.empty?
        options = type
        type = :default
      end

      raise ArgumentError, 'invalid schedule type' unless SCHEDULE_TYPES[type]

      get(SCHEDULE_TYPES[type], options)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mlb_stats_api-0.2.1 lib/mlb_stats_api/schedules.rb