Module: Sports::Butler
- Defined in:
- lib/sports/butler.rb,
lib/sports/butler/api.rb,
lib/sports/butler/base.rb,
lib/sports/butler/soccer.rb,
lib/sports/butler/utility.rb,
lib/sports/butler/version.rb,
lib/sports/butler/api_base.rb,
lib/sports/butler/endpoints.rb,
lib/sports/butler/basketball.rb,
lib/sports/butler/configuration.rb,
lib/sports/butler/shared/api_coms.rb,
lib/sports/butler/soccer_api/base.rb,
lib/sports/butler/soccer_api/odds.rb,
lib/sports/butler/soccer_api/teams.rb,
lib/sports/butler/shared/all_sports.rb,
lib/sports/butler/soccer_api/coachs.rb,
lib/sports/butler/soccer_api/venues.rb,
lib/sports/butler/soccer_api/lineups.rb,
lib/sports/butler/soccer_api/matches.rb,
lib/sports/butler/soccer_api/players.rb,
lib/sports/butler/soccer_api/scorers.rb,
lib/sports/butler/basketball_api/base.rb,
lib/sports/butler/basketball_api/odds.rb,
lib/sports/butler/soccer_api/injuries.rb,
lib/sports/butler/soccer_api/trophies.rb,
lib/sports/butler/basketball_api/teams.rb,
lib/sports/butler/soccer_api/countries.rb,
lib/sports/butler/soccer_api/standings.rb,
lib/sports/butler/soccer_api/timezones.rb,
lib/sports/butler/soccer_api/transfers.rb,
lib/sports/butler/soccer_api/sidelineds.rb,
lib/sports/butler/soccer_api/statistics.rb,
lib/sports/butler/basketball_api/matches.rb,
lib/sports/butler/basketball_api/seasons.rb,
lib/sports/butler/soccer_api/predictions.rb,
lib/sports/butler/soccer_api/competitions.rb,
lib/sports/butler/soccer_api/head_to_head.rb,
lib/sports/butler/basketball_api/countries.rb,
lib/sports/butler/basketball_api/standings.rb,
lib/sports/butler/basketball_api/timezones.rb,
lib/sports/butler/basketball_api/statistics.rb,
lib/sports/butler/basketball_api/competitions.rb,
lib/sports/butler/soccer_api/apifootball_com/odds.rb,
lib/sports/butler/soccer_api/api_football_com/odds.rb,
lib/sports/butler/soccer_api/apifootball_com/teams.rb,
lib/sports/butler/soccer_api/api_football_com/teams.rb,
lib/sports/butler/soccer_api/football_data_org/base.rb,
lib/sports/butler/soccer_api/football_data_org/odds.rb,
lib/sports/butler/soccer_api/api_football_com/coachs.rb,
lib/sports/butler/soccer_api/api_football_com/venues.rb,
lib/sports/butler/soccer_api/apifootball_com/lineups.rb,
lib/sports/butler/soccer_api/apifootball_com/matches.rb,
lib/sports/butler/soccer_api/apifootball_com/players.rb,
lib/sports/butler/soccer_api/apifootball_com/scorers.rb,
lib/sports/butler/soccer_api/football_data_org/teams.rb,
lib/sports/butler/soccer_api/api_football_com/lineups.rb,
lib/sports/butler/soccer_api/api_football_com/matches.rb,
lib/sports/butler/soccer_api/api_football_com/players.rb,
lib/sports/butler/soccer_api/api_football_com/scorers.rb,
lib/sports/butler/soccer_api/api_football_com/injuries.rb,
lib/sports/butler/soccer_api/api_football_com/trophies.rb,
lib/sports/butler/soccer_api/apifootball_com/countries.rb,
lib/sports/butler/soccer_api/apifootball_com/standings.rb,
lib/sports/butler/soccer_api/football_data_org/lineups.rb,
lib/sports/butler/soccer_api/football_data_org/matches.rb,
lib/sports/butler/soccer_api/football_data_org/players.rb,
lib/sports/butler/soccer_api/football_data_org/scorers.rb,
lib/sports/butler/soccer_api/api_football_com/countries.rb,
lib/sports/butler/soccer_api/api_football_com/standings.rb,
lib/sports/butler/soccer_api/api_football_com/timezones.rb,
lib/sports/butler/soccer_api/api_football_com/transfers.rb,
lib/sports/butler/soccer_api/apifootball_com/statistics.rb,
lib/sports/butler/basketball_api/api_basketball_com/odds.rb,
lib/sports/butler/soccer_api/api_football_com/sidelineds.rb,
lib/sports/butler/soccer_api/api_football_com/statistics.rb,
lib/sports/butler/soccer_api/apifootball_com/predictions.rb,
lib/sports/butler/soccer_api/football_data_org/countries.rb,
lib/sports/butler/soccer_api/football_data_org/standings.rb,
lib/sports/butler/basketball_api/api_basketball_com/teams.rb,
lib/sports/butler/soccer_api/api_football_com/predictions.rb,
lib/sports/butler/soccer_api/apifootball_com/competitions.rb,
lib/sports/butler/soccer_api/apifootball_com/head_to_head.rb,
lib/sports/butler/soccer_api/api_football_com/competitions.rb,
lib/sports/butler/soccer_api/api_football_com/head_to_head.rb,
lib/sports/butler/basketball_api/api_basketball_com/matches.rb,
lib/sports/butler/basketball_api/api_basketball_com/seasons.rb,
lib/sports/butler/soccer_api/football_data_org/competitions.rb,
lib/sports/butler/soccer_api/football_data_org/head_to_head.rb,
lib/sports/butler/basketball_api/api_basketball_com/countries.rb,
lib/sports/butler/basketball_api/api_basketball_com/standings.rb,
lib/sports/butler/basketball_api/api_basketball_com/timezones.rb,
lib/sports/butler/basketball_api/api_basketball_com/statistics.rb,
lib/sports/butler/basketball_api/api_basketball_com/competitions.rb
Defined Under Namespace
Modules: BasketballApi, Shared, SoccerApi Classes: Api, ApiBase, Base, Basketball, Configuration, Endpoints, MissingEndpoint, Soccer, Utility
Constant Summary collapse
- DEFAULT_SPORT =
:soccer
- DEFAULT_API =
:api_football_com
- VERSION =
Initial Release Version: January 2022
Supported Sports:
-
Football (aka Soccer)
-
Basketball
Supported APIs:
-
api-football.com (>= 1.0.0)
-
apifootball.com (>= 1.0.0)
-
www.football-data.org (>= 1.0.0)
-
api-basketball.com (>= 1.0.0)
-
"1.0.2"
Class Method Summary collapse
-
.get(url:, sport: nil, api_name: nil, filters: {}, headers: {}) ⇒ Object
Sports::Butler direct API call without Endpoint Classes.
-
.new(sport: DEFAULT_SPORT, api_name: DEFAULT_API) ⇒ Object
Sports::Butler Object build.
-
.show_endpoints ⇒ Object
Sports::Butler show all endpoints in console output (info).
Class Method Details
.get(url:, sport: nil, api_name: nil, filters: {}, headers: {}) ⇒ Object
Sports::Butler direct API call without Endpoint Classes
29 30 31 |
# File 'lib/sports/butler.rb', line 29 def get(url:, sport: nil, api_name: nil, filters: {}, headers: {}) Api.get(url: url, sport: sport, api_name: api_name, filters: filters, headers: headers) end |
.new(sport: DEFAULT_SPORT, api_name: DEFAULT_API) ⇒ Object
Sports::Butler Object build
20 21 22 23 24 25 26 |
# File 'lib/sports/butler.rb', line 20 def new(sport: DEFAULT_SPORT, api_name: DEFAULT_API) if Sports::Butler::Configuration.valid_sport_api?(sport, api_name) "Sports::Butler::#{sport.to_s.capitalize}".constantize.new(sport: sport, api_name: api_name) else text_error_sport_api end end |