Class: Football::Butler::FootballData::Teams
- Defined in:
- lib/football/butler/football_data/teams.rb
Constant Summary collapse
- PATH =
:teams
Constants inherited from Base
Class Method Summary collapse
-
.by_competition(id:, result:, filters:) ⇒ Object
TEAMS.
-
.by_competition_and_year(id:, year:, result:, filters:) ⇒ Object
v2/competitions/id/teams?year=year.
-
.by_id(id:) ⇒ Object
TEAM v2/teams/id returns team object directly as a hash.
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
TEAMS
season=YEAR stage=STAGE
v2/competitions/id/teams
24 25 26 27 |
# File 'lib/football/butler/football_data/teams.rb', line 24 def by_competition(id:, result:, filters:) path = "#{Competitions::PATH}/#{id}/#{PATH}" Api.get(path: path, result: result, filters: filters) end |
.by_competition_and_year(id:, year:, result:, filters:) ⇒ Object
v2/competitions/id/teams?year=year
30 31 32 33 34 |
# File 'lib/football/butler/football_data/teams.rb', line 30 def by_competition_and_year(id:, year:, result:, filters:) path = "#{Competitions::PATH}/#{id}/#{PATH}" filters.merge!({ year: year }) Api.get(path: path, result: result, filters: filters) end |