Sha256: cb802c238e0764943391ee9517230d32aab1535475b53cb1613403e28d91c251

Contents?: true

Size: 766 Bytes

Versions: 4

Compression:

Stored size: 766 Bytes

Contents

# frozen_string_literal: true

module MLBStatsAPI
  # Operations pertaining to sports
  # @see https://statsapi.mlb.com/docs/#tag/sports
  module Sports
    # View information for all sportIds.
    # @see https://statsapi.mlb.com/docs/#operation/sports
    def sports
      get '/sports'
    end

    # View information for any given sportId.
    # @see https://statsapi.mlb.com/docs/#operation/sports
    def sport(sport_id, options = {})
      get "/sports/#{sport_id}", options
    end

    # View information on a players for a given sportId.
    # @see https://statsapi.mlb.com/docs/#operation/sportPlayers
    def sport_players(sport_id, season, options = {})
      options[:season] = season

      get "/sports/#{sport_id}/players", options
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mlb_stats_api-0.2.5 lib/mlb_stats_api/sports.rb
mlb_stats_api-0.2.4 lib/mlb_stats_api/sports.rb
mlb_stats_api-0.2.3 lib/mlb_stats_api/sports.rb
mlb_stats_api-0.2.2 lib/mlb_stats_api/sports.rb