Constantize the API Adresse URL

This commit is contained in:
gregoirenovel 2018-10-15 16:36:16 +02:00
parent ca8af0e904
commit a7a6898ce3
2 changed files with 2 additions and 5 deletions

View file

@ -8,13 +8,9 @@ module ApiAdresse
end
def call
RestClient.get(api_url, params: { q: @address, limit: @limit })
RestClient.get(API_ADRESSE_URL, params: { q: @address, limit: @limit })
rescue RestClient::ServiceUnavailable
nil
end
def api_url
'http://api-adresse.data.gouv.fr/search'
end
end
end