Class: SportsOddsAPI::Resources::Events
- Inherits:
-
Object
- Object
- SportsOddsAPI::Resources::Events
- Defined in:
- lib/sports_odds_api/resources/events.rb,
sig/sports_odds_api/resources/events.rbs
Instance Method Summary collapse
-
#get(bookmaker_id: nil, cancelled: nil, cursor: nil, ended: nil, event_id: nil, event_ids: nil, finalized: nil, include_alt_lines: nil, include_opposing_odds: nil, league_id: nil, limit: nil, live: nil, odd_id: nil, odds_available: nil, odds_present: nil, player_id: nil, sport_id: nil, started: nil, starts_after: nil, starts_before: nil, team_id: nil, type: nil, request_options: {}) ⇒ SportsOddsAPI::Internal::NextCursorPage<SportsOddsAPI::Models::Event>
Some parameter documentations has been truncated, see Models::EventGetParams for more details.
-
#initialize(client:) ⇒ Events
constructor
private
A new instance of Events.
Constructor Details
#initialize(client:) ⇒ Events
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 Events.
92 93 94 |
# File 'lib/sports_odds_api/resources/events.rb', line 92 def initialize(client:) @client = client end |
Instance Method Details
#get(bookmaker_id: nil, cancelled: nil, cursor: nil, ended: nil, event_id: nil, event_ids: nil, finalized: nil, include_alt_lines: nil, include_opposing_odds: nil, league_id: nil, limit: nil, live: nil, odd_id: nil, odds_available: nil, odds_present: nil, player_id: nil, sport_id: nil, started: nil, starts_after: nil, starts_before: nil, team_id: nil, type: nil, request_options: {}) ⇒ SportsOddsAPI::Internal::NextCursorPage<SportsOddsAPI::Models::Event>
Some parameter documentations has been truncated, see Models::EventGetParams for more details.
Get a list of Events
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/sports_odds_api/resources/events.rb', line 62 def get(params = {}) parsed, = SportsOddsAPI::EventGetParams.dump_request(params) @client.request( method: :get, path: "events/", query: parsed.transform_keys( bookmaker_id: "bookmakerID", event_id: "eventID", event_ids: "eventIDs", include_alt_lines: "includeAltLines", include_opposing_odds: "includeOpposingOdds", league_id: "leagueID", odd_id: "oddID", odds_available: "oddsAvailable", odds_present: "oddsPresent", player_id: "playerID", sport_id: "sportID", starts_after: "startsAfter", starts_before: "startsBefore", team_id: "teamID" ), page: SportsOddsAPI::Internal::NextCursorPage, model: SportsOddsAPI::Event, options: ) end |