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
Overview
Get info about Events (includes odds, results, teams, and other metadata)
Instance Method Summary collapse
-
#get(bookmaker_id: nil, cancelled: nil, cursor: nil, ended: nil, event_id: nil, event_ids: nil, expand_results: nil, finalized: nil, include_alt_lines: nil, include_open_close_odds: 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.
100 101 102 |
# File 'lib/sports_odds_api/resources/events.rb', line 100 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, expand_results: nil, finalized: nil, include_alt_lines: nil, include_open_close_odds: 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
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/sports_odds_api/resources/events.rb', line 67 def get(params = {}) parsed, = SportsOddsAPI::EventGetParams.dump_request(params) query = SportsOddsAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "events/", query: query.transform_keys( bookmaker_id: "bookmakerID", event_id: "eventID", event_ids: "eventIDs", expand_results: "expandResults", include_alt_lines: "includeAltLines", include_open_close_odds: "includeOpenCloseOdds", 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 |