class Sports::Butler::SoccerApi::FootballDataOrg::Odds

Public Instance Methods

by_match(match_id:, filters: {}) click to toggle source
# File lib/sports/butler/soccer_api/football_data_org/odds.rb, line 8
def by_match(match_id:, filters: {})
  api.get(path: "#{path}/#{match_id}", filters: filters)
  response = api.response.parsed_response

  if response.is_a?(Hash) && response.with_indifferent_access.dig(:match) &&
    response['match'].with_indifferent_access.dig(:odds)
    api.parsed_response = response['match']['odds']
  else
    api.parsed_response = response
  end

  api
end