Skip to content

Commit

Permalink
Handle unused args
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoack committed Oct 10, 2016
1 parent f452329 commit 21d6c0a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/geokit/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def try(*a, &b)
end

class NilClass
def try(*args)
def try(*_args)
nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/geokit/geocoders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def self.call_geocoder_service(url)
# Not all geocoders can do reverse geocoding. So, unless the subclass explicitly overrides this method,
# a call to reverse_geocode will return an empty GeoLoc. If you happen to be using MultiGeocoder,
# this will cause it to failover to the next geocoder, which will hopefully be one which supports reverse geocoding.
def self.do_reverse_geocode(latlng)
def self.do_reverse_geocode(_latlng)
GeoLoc.new
end

Expand Down
4 changes: 2 additions & 2 deletions lib/geokit/geocoders/mapbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class MapboxGeocoder < Geocoder
private

# Template method which does the reverse-geocode lookup.
def self.do_reverse_geocode(latlng, options = {})
def self.do_reverse_geocode(latlng, _options = nil)
latlng = LatLng.normalize(latlng)
url = "#{protocol}://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/"
url += "#{latlng.lng},#{latlng.lat}.json?access_token=#{key}"
process :json, url
end

# Template method which does the geocode lookup.
def self.do_geocode(address, options = {})
def self.do_geocode(address, _options = nil)
address_str = address.is_a?(GeoLoc) ? address.to_geocodeable_s : address
url = "#{protocol}://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/"
url += "#{Geokit::Inflector.url_escape(address_str)}.json?access_token=#{key}"
Expand Down
2 changes: 1 addition & 1 deletion lib/geokit/multi_geocoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def self.do_geocode(address, *args)
# This method will call one or more geocoders in the order specified in
# the configuration until one of the geocoders work, only this time it's
# going to try to reverse geocode a geographical point.
def self.do_reverse_geocode(latlng, *args)
def self.do_reverse_geocode(latlng, *_args)
Geokit::Geocoders.provider_order.each do |provider|
klass = geocoder(provider)
begin
Expand Down
3 changes: 1 addition & 2 deletions test/test_base_geocoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Base class for testing geocoders.
class BaseGeocoderTest < Test::Unit::TestCase #:nodoc: all
class Geokit::Geocoders::TestGeocoder < Geokit::Geocoders::Geocoder
def self.do_get(url)
sleep(2)
def self.do_get(_url)
end
end

Expand Down

0 comments on commit 21d6c0a

Please sign in to comment.