Skip to content
Snippets Groups Projects
Commit 23ec46e9 authored by Egor Bikov's avatar Egor Bikov
Browse files

add object kind recognising for yandex result object

parent fecc20dd
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,10 @@ module Geocoder::Result
address_details['Locality']['Premise']['PremiseName']
end
def kind
@data['GeoObject']['metaDataProperty']['GeocoderMetaData']['kind']
end
def precision
@data['GeoObject']['metaDataProperty']['GeocoderMetaData']['precision']
end
......
......@@ -30,6 +30,16 @@ class ResultTest < Test::Unit::TestCase
end
end
def test_yandex_result_kind
assert_nothing_raised do
Geocoder.configure(:lookup => :yandex)
set_api_key!(:yandex)
["new york", [45.423733, -75.676333], "no city and town"].each do |query|
Geocoder.search("new york").first.kind
end
end
end
private # ------------------------------------------------------------------
def assert_result_has_required_attributes(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment