Module: MLBStatsAPI::Sports

Included in:
Client
Defined in:
lib/mlb_stats_api/sports.rb

Overview

Operations pertaining to sports

Instance Method Summary collapse

Instance Method Details

#sport(sport_id, **options) ⇒ Object

View information for any given sport ID.



10
# File 'lib/mlb_stats_api/sports.rb', line 10

def sport(sport_id, **options) = get("/sports/#{sport_id}", **options)

#sport_players(sport_id, season, **options) ⇒ Object

View information on all players for a given sport ID, optionally filtered by season.



13
# File 'lib/mlb_stats_api/sports.rb', line 13

def sport_players(sport_id, season, **options) = get("/sports/#{sport_id}/players", **options.merge(season:))

#sportsObject

View information for all sports.



7
# File 'lib/mlb_stats_api/sports.rb', line 7

def sports = get('/sports')