diff --git a/Gemfile.lock b/Gemfile.lock index cf325a9..694e48c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - football_api (0.1.4) + football_api (0.1.5) GEM remote: https://rubygems.org/ diff --git a/lib/football_api/base_resource.rb b/lib/football_api/base_resource.rb index 5f32762..385cd99 100644 --- a/lib/football_api/base_resource.rb +++ b/lib/football_api/base_resource.rb @@ -20,6 +20,7 @@ def fetch(ident = nil, **options) uri = [path, ident].compact.join('/') query_params = build_params(options) uri += query_params if query_params + uri = URI.encode(uri) format_result(get(uri)) end diff --git a/lib/football_api/coach.rb b/lib/football_api/coach.rb index 59dde0e..53b1961 100644 --- a/lib/football_api/coach.rb +++ b/lib/football_api/coach.rb @@ -12,9 +12,7 @@ def all_by_team(team_id, **options) end def search(name, **options) - search_term = URI.encode(name) - - fetch("search/#{search_term}", options) + fetch("search/#{name}", options) end private diff --git a/lib/football_api/league.rb b/lib/football_api/league.rb index 0fcbbf0..ef449b0 100644 --- a/lib/football_api/league.rb +++ b/lib/football_api/league.rb @@ -16,9 +16,7 @@ def all_by_team_and_season(team_id, season, **options) end def search(name_or_country, **options) - search_term = URI.encode(name_or_country) - - fetch("search/#{search_term}", options) + fetch("search/#{name_or_country}", options) end def all_by_country(country, **options) diff --git a/lib/football_api/teams/data.rb b/lib/football_api/teams/data.rb index 853103a..9719f97 100644 --- a/lib/football_api/teams/data.rb +++ b/lib/football_api/teams/data.rb @@ -13,9 +13,7 @@ def all_by_league(league_id, **options) end def search(name_or_country, **options) - search_term = URI.encode(name_or_country) - - fetch("search/#{search_term}", options) + fetch("search/#{name_or_country}", options) end private