Class: SportsApi::Football::OddsLiveBetResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/sports_api/football/resources/odds_in_play/odds_live_bet.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#get_request, #initialize

Constructor Details

This class inherits a constructor from SportsApi::Resource

Instance Method Details

#find(id:) ⇒ Object



14
15
16
17
# File 'lib/sports_api/football/resources/odds_in_play/odds_live_bet.rb', line 14

def find(id:)
  response = get_request('odds/live/bets', params: { id: id.to_s })
  SportsApi::Football::OddsLiveBet.new(response.body['response'][0])
end

#list(**params) ⇒ Object

Arguments: id: [Integer](optional) - The bet ID. search: [String](optional) - The name of the bet (>= XXX).



9
10
11
12
# File 'lib/sports_api/football/resources/odds_in_play/odds_live_bet.rb', line 9

def list(**params)
  response = get_request('odds/live/bets', params:)
  Collection.from_response(response, type: SportsApi::Football::OddsLiveBet)
end