Class: SportsOddsAPI::Resources::Stats
- Inherits:
-
Object
- Object
- SportsOddsAPI::Resources::Stats
- Defined in:
- lib/sports_odds_api/resources/stats.rb,
sig/sports_odds_api/resources/stats.rbs
Instance Method Summary collapse
-
#get(sport_id: nil, stat_id: nil, stat_level: nil, request_options: {}) ⇒ Array<SportsOddsAPI::Models::Stat>
Some parameter documentations has been truncated, see Models::StatGetParams for more details.
-
#initialize(client:) ⇒ Stats
constructor
private
A new instance of Stats.
Constructor Details
#initialize(client:) ⇒ Stats
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 Stats.
39 40 41 |
# File 'lib/sports_odds_api/resources/stats.rb', line 39 def initialize(client:) @client = client end |
Instance Method Details
#get(sport_id: nil, stat_id: nil, stat_level: nil, request_options: {}) ⇒ Array<SportsOddsAPI::Models::Stat>
Some parameter documentations has been truncated, see Models::StatGetParams for more details.
Get a list of StatIDs
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sports_odds_api/resources/stats.rb', line 24 def get(params = {}) parsed, = SportsOddsAPI::StatGetParams.dump_request(params) @client.request( method: :get, path: "stats/", query: parsed.transform_keys(sport_id: "sportID", stat_id: "statID", stat_level: "statLevel"), unwrap: :data, model: SportsOddsAPI::Internal::Type::ArrayOf[SportsOddsAPI::Stat], options: ) end |