Module: MLBStatsAPI::Sports
- Included in:
- Client
- Defined in:
- lib/mlb_stats_api/sports.rb
Overview
Operations pertaining to sports
Instance Method Summary collapse
-
#sport(sport_id, **options) ⇒ Object
View information for any given sport ID.
-
#sport_players(sport_id, season, **options) ⇒ Object
View information on all players for a given sport ID, optionally filtered by season.
-
#sports ⇒ Object
View information for all sports.
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, **) = get("/sports/#{sport_id}", **) |
#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, **) = get("/sports/#{sport_id}/players", **.merge(season:)) |
#sports ⇒ Object
View information for all sports.
7 |
# File 'lib/mlb_stats_api/sports.rb', line 7 def sports = get('/sports') |