class Sports::Butler::SoccerApi::ApifootballCom::Matches

Public Instance Methods

available_endpoint_methods() click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 8
def available_endpoint_methods
  [:by_id, :by_competition_and_year, :by_team_and_range, :by_competition_and_range]
end
build_path(action) click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 12
def build_path(action)
  "action=#{action}"
end
by_competition_and_year(competition_id:, year:, filters: {}) click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 20
def by_competition_and_year(competition_id:, year:, filters: {})
  from  = "#{year}-01-01"
  to    = "#{year}-12-31"
  filters.merge!({ league_id: competition_id, from: from, to: to })
  api.get(path: build_path(path), filters: filters)
  api
end
filters_by_competition_and_range(competition_id, from, to) click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 32
def filters_by_competition_and_range(competition_id, from, to)
  { league_id: competition_id, from: from, to: to }
end
filters_by_id(id) click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 28
def filters_by_id(id)
  { match_id: id }
end
path() click to toggle source
# File lib/sports/butler/soccer_api/apifootball_com/matches.rb, line 16
def path
  :get_events
end