class Football::Butler::FootballData::Odds

Constants

PATH

Public Class Methods

by_match(id:, from:, to:, result:) click to toggle source
ODDS

v2/matches/{id}

# File lib/football/butler/football_data/odds.rb, line 13
def by_match(id:, from:, to:, result:)
  path  = "#{PATH}/#{id}"
  match = Api.get(path: path, result: :match)

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