X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/898cc828dd1f1167f85abbf35c8e3f0ed640ac1e..b650a2272544c51ee9ec8bce33bcb113bfd579e8:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 393011dac..ba28378f3 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -298,6 +298,23 @@ module OSM end end + # raised when a two preferences have a duplicate key string. + class APIDuplicatePreferenceError < APIError + def initialize(key) + @key = key + end + + attr_reader :key + + def status + :bad_request + end + + def to_s + "Duplicate preferences with key #{@key}" + end + end + # Helper methods for going to/from mercator and lat/lng. class Mercator include Math @@ -497,7 +514,7 @@ module OSM country = "GB" if country == "UK" end end - + return country.upcase end