From b7ea3461eb0706a277d50ab6ca7c3c107426efb8 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Sat, 9 Feb 2013 14:22:07 -0500 Subject: [PATCH] Bring datenimperator-add-ovi up to date w/ changes in master. Ideally, datenimperator-add-ovi would have been rebased to master before being merged. --- lib/geocoder/lookups/ovi.rb | 20 +++++++++++++------ ..._garden.json => ovi_madison_square_garden} | 0 .../{ovi_no_results.json => ovi_no_results} | 0 3 files changed, 14 insertions(+), 6 deletions(-) rename test/fixtures/{ovi_madison_square_garden.json => ovi_madison_square_garden} (100%) rename test/fixtures/{ovi_no_results.json => ovi_no_results} (100%) diff --git a/lib/geocoder/lookups/ovi.rb b/lib/geocoder/lookups/ovi.rb index 8831bc88..5dcf91c5 100644 --- a/lib/geocoder/lookups/ovi.rb +++ b/lib/geocoder/lookups/ovi.rb @@ -6,6 +6,18 @@ require 'geocoder/results/ovi' module Geocoder::Lookup class Ovi < Base + def name + "Ovi" + end + + def required_api_key_parts + [] + end + + def query_url(query) + "http://lbs.ovi.com/search/6.2/geocode.json?" + url_query_string(query) + end + private # --------------------------------------------------------------- def results(query) @@ -28,19 +40,15 @@ module Geocoder::Lookup end def api_key - if a=Geocoder::Configuration.api_key + if a=configuration.api_key return a.first if a.is_a?(Array) end end def api_code - if a=Geocoder::Configuration.api_key + if a=configuration.api_key return a.last if a.is_a?(Array) end end - - def query_url(query) - "http://lbs.ovi.com/search/6.2/geocode.json?" + url_query_string(query) - end end end diff --git a/test/fixtures/ovi_madison_square_garden.json b/test/fixtures/ovi_madison_square_garden similarity index 100% rename from test/fixtures/ovi_madison_square_garden.json rename to test/fixtures/ovi_madison_square_garden diff --git a/test/fixtures/ovi_no_results.json b/test/fixtures/ovi_no_results similarity index 100% rename from test/fixtures/ovi_no_results.json rename to test/fixtures/ovi_no_results -- GitLab