Class: Football::Butler::ApiFootball::Trophies
- Inherits:
-
BaseApiFootball
- Object
- Base
- BaseApiFootball
- Football::Butler::ApiFootball::Trophies
- Defined in:
- lib/football/butler/api_football/trophies.rb
Constant Summary collapse
- PATH =
:trophies
Constants inherited from Base
Class Method Summary collapse
-
.by_coach(coach:, result:, filters:) ⇒ Object
/trophies?coach=coach.
-
.by_player(player:, result:, filters:) ⇒ Object
TROPHIES.
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_coach(coach:, result:, filters:) ⇒ Object
/trophies?coach=coach
28 29 30 31 |
# File 'lib/football/butler/api_football/trophies.rb', line 28 def by_coach(coach:, result:, filters:) filters.merge!({ coach: coach }) Api.get(path: PATH, filters: filters, result: result) end |
.by_player(player:, result:, filters:) ⇒ Object
TROPHIES
player integer The id of the player
coach integer The id of the coach
/trophies?player=player
22 23 24 25 |
# File 'lib/football/butler/api_football/trophies.rb', line 22 def by_player(player:, result:, filters:) filters.merge!({ player: player }) Api.get(path: PATH, filters: filters, result: result) end |