From a236e32b24bda49731d9fd54d1992670954f912c Mon Sep 17 00:00:00 2001 From: dreamfall <amarant.st@gmail.com> Date: Thu, 27 Sep 2012 23:49:36 +0300 Subject: [PATCH] do not redefine "type" method --- lib/geocoder/results/nominatim.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/geocoder/results/nominatim.rb b/lib/geocoder/results/nominatim.rb index 1235bd7d..07536814 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 -- GitLab