Class: Football::Butler::FootballData::Lineups
- Defined in:
- lib/football/butler/football_data/lineups.rb
Constant Summary collapse
- PATH =
:matches
Constants inherited from Base
Class Method Summary collapse
-
.by_match(id:) ⇒ Object
LINEUPS.
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_match(id:) ⇒ Object
LINEUPS
v2/matches/id
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/football/butler/football_data/lineups.rb', line 13 def by_match(id:) path = "#{PATH}/#{id}" match = Api.get(path: path, result: :match) if match.is_a?(Hash) && match.with_indifferent_access.dig(:homeTeam) && match.with_indifferent_access.dig(:awayTeam) lineups = {} lineups['homeTeam'] = match['homeTeam'] lineups['awayTeam'] = match['awayTeam'] lineups else match end end |