class Football::Butler::FootballData::HeadToHead

Constants

PATH

Public Class Methods

by_match(id:) click to toggle source
HEAD TO HEAD

v2/matches/{id}

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

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