Class: Football::Butler::Apifootball::Teams

Inherits:
BaseApifootball show all
Defined in:
lib/football/butler/apifootball/teams.rb

Constant Summary collapse

PATH =
:get_teams

Constants inherited from Base

Base::MSG_INVALID_CONFIG

Class Method Summary collapse

Methods inherited from BaseApifootball

build_path

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(id:, result:, filters:) ⇒ Object

COMPETITION action=get_teams&league_id=id



20
21
22
23
# File 'lib/football/butler/apifootball/teams.rb', line 20

def by_competition(id:, result:, filters:)
  filters.merge!({ league_id: id })
  Api.get(path: build_path(PATH), result: result, filters: filters)
end

.by_id(id:) ⇒ Object

TEAM action=get_teams&team_id=id



13
14
15
16
# File 'lib/football/butler/apifootball/teams.rb', line 13

def by_id(id:)
  filters = { team_id: id }
  Api.get(path: build_path(PATH), filters: filters, result: :parsed_response)
end