module SoccersApi class League class << self require 'rest-client' LEAGUE = 'leagues'.freeze def all SoccersApi.api_url(api_for: LEAGUE, type: "list") end def by_id(id) SoccersApi.api_url( api_for: LEAGUE, type: "info", id_type: 'id', id: id ) end def by_country(country_id) SoccersApi.api_url( api_for: LEAGUE, type: "list", id_type: 'country_id', id: country_id ) end def standings(season_id) SoccersApi.api_url( api_for: LEAGUE, type: "standings", id_type: 'season_id', id: season_id ) end end end end