Class: SportsOddsAPI::Resources::Leagues
- Inherits:
-
Object
- Object
- SportsOddsAPI::Resources::Leagues
- Defined in:
- lib/sports_odds_api/resources/leagues.rb,
sig/sports_odds_api/resources/leagues.rbs
Instance Method Summary collapse
-
#get(league_id: nil, sport_id: nil, request_options: {}) ⇒ Array<SportsOddsAPI::Models::League>
Get a list of Leagues.
-
#initialize(client:) ⇒ Leagues
constructor
private
A new instance of Leagues.
Constructor Details
#initialize(client:) ⇒ Leagues
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.
Returns a new instance of Leagues.
34 35 36 |
# File 'lib/sports_odds_api/resources/leagues.rb', line 34 def initialize(client:) @client = client end |
Instance Method Details
#get(league_id: nil, sport_id: nil, request_options: {}) ⇒ Array<SportsOddsAPI::Models::League>
Get a list of Leagues
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sports_odds_api/resources/leagues.rb', line 19 def get(params = {}) parsed, = SportsOddsAPI::LeagueGetParams.dump_request(params) @client.request( method: :get, path: "leagues/", query: parsed.transform_keys(league_id: "leagueID", sport_id: "sportID"), unwrap: :data, model: SportsOddsAPI::Internal::Type::ArrayOf[SportsOddsAPI::League], options: ) end |