diff --git a/lib/geocoder/results/nominatim.rb b/lib/geocoder/results/nominatim.rb index 1235bd7d9a8b4ae73445a658a445709b269f81e6..07536814ea4789b7cf16ce0a5a475f04d461885d 100644 --- a/lib/geocoder/results/nominatim.rb +++ b/lib/geocoder/results/nominatim.rb @@ -74,6 +74,10 @@ module Geocoder::Result @data['class'] end + def place_type + @data['type'] + end + def self.response_attributes %w[place_id osm_type osm_id boundingbox license polygonpoints display_name class type stadium] @@ -84,6 +88,11 @@ module Geocoder::Result @data['class'] end + def type + warn "DEPRECATION WARNING: The 'type' method of Geocoder::Result::Nominatim objects is deprecated and will be removed in Geocoder version 1.2.0. Please use 'place_type' instead." + @data['type'] + end + response_attributes.each do |a| unless method_defined?(a) define_method a do