Module: MLBStatsAPI::Stats
- Included in:
- Client
- Defined in:
- lib/mlb_stats_api/stats.rb
Overview
Operations pertaining to stats
Instance Method Summary collapse
-
#stats(options = {}) ⇒ Object
View statistics based on statType, group, season, and organization.
-
#stats_leaders(options = {}) ⇒ Object
View leaders for a statistic.
Instance Method Details
#stats(options = {}) ⇒ Object
View statistics based on statType, group, season, and organization.
9 10 11 12 13 14 |
# File 'lib/mlb_stats_api/stats.rb', line 9 def stats( = {}) raise ArgumentError, '#stats requires a stats arg' unless [:stats] raise ArgumentError, '#stats requires a group arg' unless [:group] get '/stats', end |
#stats_leaders(options = {}) ⇒ Object
View leaders for a statistic.
18 19 20 21 22 23 24 |
# File 'lib/mlb_stats_api/stats.rb', line 18 def stats_leaders( = {}) unless [:leaderCategories] raise ArgumentError, '#stats_leaders requires a leaderCategories arg' end get '/stats/leaders', end |