module MLBStatsAPI::Stats

Operations pertaining to stats @see statsapi.mlb.com/docs/#tag/stats

Public Instance Methods

stats(options = {}) click to toggle source

View statistics based on statType, group, season, and organization. @see statsapi.mlb.com/docs/#operation/stats

# File lib/mlb_stats_api/stats.rb, line 9
def stats(options = {})
  raise ArgumentError, '#stats requires a stats arg' unless options[:stats]
  raise ArgumentError, '#stats requires a group arg' unless options[:group]

  get '/stats', options
end
stats_leaders(options = {}) click to toggle source

View leaders for a statistic. @see statsapi.mlb.com/docs/#operation/leaders

# File lib/mlb_stats_api/stats.rb, line 18
def stats_leaders(options = {})
  unless options[:leaderCategories]
    raise ArgumentError, '#stats_leaders requires a leaderCategories arg'
  end

  get '/stats/leaders', options
end