Class: SportsOddsAPI::Resources::Players
- Inherits:
-
Object
- Object
- SportsOddsAPI::Resources::Players
- Defined in:
- lib/sports_odds_api/resources/players.rb,
sig/sports_odds_api/resources/players.rbs
Instance Method Summary collapse
-
#get(cursor: nil, event_id: nil, limit: nil, player_id: nil, team_id: nil, request_options: {}) ⇒ SportsOddsAPI::Internal::NextCursorPage<SportsOddsAPI::Models::Player>
Some parameter documentations has been truncated, see Models::PlayerGetParams for more details.
-
#initialize(client:) ⇒ Players
constructor
private
A new instance of Players.
Constructor Details
#initialize(client:) ⇒ Players
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 Players.
43 44 45 |
# File 'lib/sports_odds_api/resources/players.rb', line 43 def initialize(client:) @client = client end |
Instance Method Details
#get(cursor: nil, event_id: nil, limit: nil, player_id: nil, team_id: nil, request_options: {}) ⇒ SportsOddsAPI::Internal::NextCursorPage<SportsOddsAPI::Models::Player>
Some parameter documentations has been truncated, see Models::PlayerGetParams for more details.
Get a list of Players for a specific Team or Event
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sports_odds_api/resources/players.rb', line 28 def get(params = {}) parsed, = SportsOddsAPI::PlayerGetParams.dump_request(params) @client.request( method: :get, path: "players/", query: parsed.transform_keys(event_id: "eventID", player_id: "playerID", team_id: "teamID"), page: SportsOddsAPI::Internal::NextCursorPage, model: SportsOddsAPI::Player, options: ) end |