Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Propagate api_key changes from upstream geocoder #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions lib/geocoder/lookups/concerns/here_lookup_default_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,24 @@ def handle
end

def required_api_key_parts
["app_id", "app_code"]
["api_key"]
end

def supported_protocols
[:https]
end

private

def query_url_here_options(query)
options = {
app_id: api_key,
app_code: api_code,
apikey: configuration.api_key,
language: (query.language || configuration.language)
}
end

def api_key
if (a = configuration.api_key)
return a.first if a.is_a?(Array)
end
end

def api_code
if (a = configuration.api_key)
return a.last if a.is_a?(Array)
end
end

def domain
if configuration.cit
'cit.api.here.com'
else
'api.here.com'
end
'ls.hereapi.com'
end
end
end