Skip to content

Commit c741d4a

Browse files
committed
do not redefine class method
1 parent 5d5b3e3 commit c741d4a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/geocoder/results/nominatim.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,20 @@ def coordinates
7070
[@data['lat'].to_f, @data['lon'].to_f]
7171
end
7272

73+
def place_class
74+
@data['class']
75+
end
76+
7377
def self.response_attributes
7478
%w[place_id osm_type osm_id boundingbox license
7579
polygonpoints display_name class type stadium]
7680
end
7781

7882
response_attributes.each do |a|
79-
define_method a do
80-
@data[a]
83+
unless method_defined?(a)
84+
define_method a do
85+
@data[a]
86+
end
8187
end
8288
end
8389
end

0 commit comments

Comments
 (0)