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 sportId.



15
16
17
# File 'lib/mlb_stats_api/sports.rb', line 15

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

#sport_players(sport_id, season, options = {}) ⇒ Object

View information on a players for a given sportId.



21
22
23
24
25
# File 'lib/mlb_stats_api/sports.rb', line 21

def sport_players(sport_id, season, options = {})
  options[:season] = season

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

#sportsObject

View information for all sportIds.



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

def sports
  get '/sports'
end