Class: Sports::Butler::SoccerApi::FootballDataOrg::Lineups
Instance Attribute Summary
Attributes inherited from Endpoints
Instance Method Summary collapse
Methods inherited from Lineups
#available_endpoint_methods, #path
Methods inherited from Base
#error_message, #method_missing, #not_found_result
Methods inherited from Endpoints
#build_path, #error_missing_endpoint_method, #filters_by_competition, #filters_by_competition_and_year, #filters_by_id, #filters_by_match, #filters_by_player, #filters_by_team, #filters_search_by_name, #initialize
Methods included from Sports::Butler::Shared::ApiComs
Methods included from Sports::Butler::Shared::AllSports
#all, #by_coach, #by_code, #by_competition, #by_competition_and_range, #by_competition_and_season, #by_competition_and_team_and_season, #by_competition_and_year, #by_country, #by_country_name, #by_id, #by_id_and_season, #by_name, #by_player, #by_season, #by_team, #by_team_and_range, #by_team_and_season, #by_teams, #search_by_name
Constructor Details
This class inherits a constructor from Sports::Butler::Endpoints
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Sports::Butler::SoccerApi::Base
Instance Method Details
#by_match(match_id:, filters: {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sports/butler/soccer_api/football_data_org/lineups.rb', line 9 def by_match(match_id:, filters: {}) api.get(path: "#{path}/#{match_id}", filters: filters) response = api.response.parsed_response if response.is_a?(Hash) && response.with_indifferent_access.dig(:match) && response['match'].with_indifferent_access.dig(:homeTeam) && response['match'].with_indifferent_access.dig(:awayTeam) lineups = {} lineups['homeTeam'] = response['match']['homeTeam'] lineups['awayTeam'] = response['match']['awayTeam'] api.parsed_response = lineups else api.parsed_response = response end api end |