Module: NBA::CumeStatsTeamGames::PathBuilder Private
- Defined in:
- lib/nba/cume_stats_team_games.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Builds API path from options
Class Method Summary collapse
-
.build(opts) ⇒ String
private
Builds the complete API path from options.
-
.build_params(opts) ⇒ Hash
private
Builds all parameters from options.
-
.optional_params(opts) ⇒ Hash
private
Builds optional parameters from options.
-
.required_params(opts) ⇒ Hash
private
Builds required parameters from options.
Class Method Details
.build(opts) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds the complete API path from options
57 58 59 |
# File 'lib/nba/cume_stats_team_games.rb', line 57 def self.build(opts) "cumestatsteamgames?#{Utils.build_query(**build_params(opts))}" end |
.build_params(opts) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds all parameters from options
65 66 67 |
# File 'lib/nba/cume_stats_team_games.rb', line 65 def self.build_params(opts) required_params(opts).merge(optional_params(opts)) end |
.optional_params(opts) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds optional parameters from options
86 87 88 89 90 91 92 |
# File 'lib/nba/cume_stats_team_games.rb', line 86 def self.optional_params(opts) { Location: opts.fetch(:location), Outcome: opts.fetch(:outcome), SeasonID: opts.fetch(:season_id), VsConference: opts.fetch(:vs_conference), VsDivision: opts.fetch(:vs_division), VsTeamID: Utils.extract_id(opts.fetch(:vs_team)) } end |
.required_params(opts) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds required parameters from options
73 74 75 76 77 78 79 80 |
# File 'lib/nba/cume_stats_team_games.rb', line 73 def self.required_params(opts) { TeamID: Utils.extract_id(opts.fetch(:team)), LeagueID: Utils.extract_league_id(opts.fetch(:league)), Season: Utils.format_season(opts.fetch(:season)), SeasonType: opts.fetch(:season_type) } end |