Class: SportsOddsAPI::Resources::Sports

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_odds_api/resources/sports.rb,
sig/sports_odds_api/resources/sports.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sports

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

Parameters:



28
29
30
# File 'lib/sports_odds_api/resources/sports.rb', line 28

def initialize(client:)
  @client = client
end

Instance Method Details

#get(request_options: {}) ⇒ Array<SportsOddsAPI::Models::Sport>

Get a list of sports

Parameters:

Returns:

See Also:



15
16
17
18
19
20
21
22
23
# File 'lib/sports_odds_api/resources/sports.rb', line 15

def get(params = {})
  @client.request(
    method: :get,
    path: "sports/",
    unwrap: :data,
    model: SportsOddsAPI::Internal::Type::ArrayOf[SportsOddsAPI::Sport],
    options: params[:request_options]
  )
end