module SoccersApi class Game class << self require 'rest-client' GAME = 'fixtures'.freeze def by_id(id) SoccersApi.api_url( api_for: GAME, type: "info", id_type: 'id', id: id ) end def lineups(id) SoccersApi.api_url( api_for: GAME, type: "match_lineups", id_type: 'id', id: id ) end def bench(id) SoccersApi.api_url( api_for: GAME, type: "match_bench", id_type: 'id', id: id ) end def events(id) SoccersApi.api_url( api_for: GAME, type: "match_events", id_type: 'id', id: id ) end def commentary(id) SoccersApi.api_url( api_for: GAME, type: "match_comments", id_type: 'id', id: id ) end def trend_analysis(id) SoccersApi.api_url( api_for: GAME, type: "match_trends", id_type: 'id', id: id ) end def by_date(date) SoccersApi.api_url( api_for: GAME, type: "schedule", id_type: 'd', id: data.strftime("%F") ) end def by_date_and_country(data:, country_id:) SoccersApi.api_url( api_for: GAME, type: "schedule", id_type: 'd', id: data.strftime("%F"), id_type_two: 'country_id', id_two:country_id ) end def by_date_and_league(data:, league_id:) SoccersApi.api_url( api_for: GAME, type: "schedule", id_type: 'd', id: data.strftime("%F"), id_type_two: 'league_id', id_two:league_id ) end def by_date_and_season(data:, season_id:) SoccersApi.api_url( api_for: GAME, type: "schedule", id_type: 'd', id: data.strftime("%F"), id_type_two: 'season_id', id_two:season_id ) end def by_season(season_id) SoccersApi.api_url( api_for: GAME, type: "season", id_type: 'season_id', id: season_id ) end def by_season_and_team(team_id:, season_id:) SoccersApi.api_url( api_for: GAME, type: "season", id_type: 'season_id', id: season_id, id_type_two: 'team_id', id_two:team_id ) end def by_round(round_id) SoccersApi.api_url( api_for: GAME, type: "round", id_type: 'round_id', id: round_id ) end def by_round_and_team(team_id:, round_id:) SoccersApi.api_url( api_for: GAME, type: "round", id_type: 'round_id', id: round_id, id_type_two: 'team_id', id_two:team_id ) end end end end