Class: Football::Butler::ApiFootball::Injuries

Inherits:
BaseApiFootball show all
Defined in:
lib/football/butler/api_football/injuries.rb

Constant Summary collapse

PATH =
:injuries

Constants inherited from Base

Base::MSG_INVALID_CONFIG

Class Method Summary collapse

Methods inherited from Base

api_class, api_switch, api_switch_method, api_switch_result, error_message, invalid_config_result, not_found_result, reached_limit?, this_class, unsupported_api_call, unsupported_api_endpoint

Class Method Details

.by_competition_and_season(competition:, season:, result:, filters:) ⇒ Object

Injuries

league integer The id of the league

season integer 4 characters YYYY The season of the league, required with league, team and player parameters

fixture integer The id of the fixture

team integer The id of the team

player integer The id of the player

date stringYYYY-MM-DD A valid date

timezone string A valid timezone from the endpoint Timezone

/injuries?ccompetition=competition&season=season



42
43
44
45
# File 'lib/football/butler/api_football/injuries.rb', line 42

def by_competition_and_season(competition:, season:, result:, filters:)
  filters.merge!({ league: competition, season: season })
  Api.get(path: PATH, result: result, filters: filters)
end

.by_match(match:, result:, filters:) ⇒ Object

/injuries?fixture=match



48
49
50
51
# File 'lib/football/butler/api_football/injuries.rb', line 48

def by_match(match:, result:, filters:)
  filters.merge!({ fixture: match })
  Api.get(path: PATH, result: result, filters: filters)
end

.by_team_and_season(team:, season:, result:, filters:) ⇒ Object

/injuries?team=team&season=season



54
55
56
57
# File 'lib/football/butler/api_football/injuries.rb', line 54

def by_team_and_season(team:, season:, result:, filters:)
  filters.merge!({ team: team, season: season })
  Api.get(path: PATH, result: result, filters: filters)
end