From c741d4a7654de053a87202d881bdaf0e9ce90e49 Mon Sep 17 00:00:00 2001 From: dreamfall <amarant.st@gmail.com> Date: Sat, 15 Sep 2012 23:30:14 +0300 Subject: [PATCH] do not redefine `class` method --- lib/geocoder/results/nominatim.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/geocoder/results/nominatim.rb b/lib/geocoder/results/nominatim.rb index afd9af6f..06cbb06c 100644 --- a/lib/geocoder/results/nominatim.rb +++ b/lib/geocoder/results/nominatim.rb @@ -70,14 +70,20 @@ module Geocoder::Result [@data['lat'].to_f, @data['lon'].to_f] end + def place_class + @data['class'] + end + def self.response_attributes %w[place_id osm_type osm_id boundingbox license polygonpoints display_name class type stadium] end response_attributes.each do |a| - define_method a do - @data[a] + unless method_defined?(a) + define_method a do + @data[a] + end end end end -- GitLab