class Football::Butler::Apifootball::Events

Constants

PATH

Public Class Methods

all(result:, filters:) click to toggle source
EVENTS

timezone Default timezone: Europe/Berlin.

With this filter you can set the timezone where you want to receive the data.
Timezone is in TZ format (exemple: America/New_York). (Optional)

from Start date (yyyy-mm-dd) to Stop date (yyyy-mm-dd) country_id Country ID if set only leagues from specific country will be returned (Optional) league_id League ID if set events from specific league will be returned (Optional) match_id Match ID if set only details from specific match will be returned (Optional) team_id Team ID if set only details from specific team will be returned (Optional)

action=get_events&…<AT LEAST ONE PARAMETER IS REQUIRED!> “error”: 201, “message”: “Required parameters missing”

# File lib/football/butler/apifootball/events.rb, line 32
def all(result:, filters:)
  Api.get(path: build_path(PATH), result: result, filters: filters)
end
by_competition(id:, result:, filters:) click to toggle source
by COMPETITION

action=get_events?league_id={id}

# File lib/football/butler/apifootball/events.rb, line 38
def by_competition(id:, result:, filters:)
  filters.merge!({ league_id: id })
  Api.get(path: build_path(PATH), filters: filters, result: result)
end
by_competition_and_year(id:, year:, result:, filters:) click to toggle source

action=get_events?league_id={id}&from={year}-01-01&{year}-12-31

# File lib/football/butler/apifootball/events.rb, line 44
def by_competition_and_year(id:, year:, result:, filters:)
  from  = "#{year}-01-01"
  to    = "#{year}-12-31"
  filters.merge!({ league_id: id, from: from, to: to })
  Api.get(path: build_path(PATH), filters: filters, result: result)
end
by_id(id:) click to toggle source
EVENT

action=get_events?match_id={id}

# File lib/football/butler/apifootball/events.rb, line 13
def by_id(id:)
  filters = { match_id: id }
  Api.get(path: build_path(PATH), result: :parsed_response, filters: filters)
end
by_team(id:, result:, filters:) click to toggle source
by TEAM

action=get_events?team_id={id}

# File lib/football/butler/apifootball/events.rb, line 53
def by_team(id:, result:, filters:)
  filters.merge!({ team_id: id })
  Api.get(path: build_path(PATH), result: result, filters: filters)
end