Class: Sports::Butler::SoccerApi::Base

Inherits:
Endpoints
  • Object
show all
Defined in:
lib/sports/butler/soccer_api/base.rb

Instance Attribute Summary

Attributes inherited from Endpoints

#api, #api_name, #sport

Instance Method Summary collapse

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

#cups, #leagues

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_match, #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

#method_missing(method, *args, &block) ⇒ Object



8
9
10
# File 'lib/sports/butler/soccer_api/base.rb', line 8

def method_missing(method, *args, &block)
  return error_missing_endpoint_method(method)
end

Instance Method Details

#error_message(error) ⇒ Object



16
17
18
# File 'lib/sports/butler/soccer_api/base.rb', line 16

def error_message(error)
  { message: error }.with_indifferent_access
end

#not_found_result(*params) ⇒ Object



12
13
14
# File 'lib/sports/butler/soccer_api/base.rb', line 12

def not_found_result(*params)
  error_message("#{params.join(', ')} could not be found.")
end