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

Overview

Get Sport-related data

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:



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

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:



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

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