X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ae27f7adbe561b20203fa639ac1aa50d0408edc0..164341121da478c458f1fa0c6247388ca7a3e134:/lib/osm.rb?ds=inline 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