Skip to content
Snippets Groups Projects
Commit dbf35845 authored by Alex Reisner's avatar Alex Reisner
Browse files

Don't redefine Object#hash method.

This addresses Github issue #318.
parent 9c313da0
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,10 @@ module Geocoder::Result ...@@ -31,6 +31,10 @@ module Geocoder::Result
@data['postal'] @data['postal']
end end
def address_hash
@data['hash']
end
def self.response_attributes def self.response_attributes
%w[quality offsetlat offsetlon radius boundingbox name %w[quality offsetlat offsetlon radius boundingbox name
line1 line2 line3 line4 cross house street xstreet unittype unit line1 line2 line3 line4 cross house street xstreet unittype unit
...@@ -40,8 +44,10 @@ module Geocoder::Result ...@@ -40,8 +44,10 @@ module Geocoder::Result
end end
response_attributes.each do |a| response_attributes.each do |a|
define_method a do unless method_defined?(a)
@data[a] define_method a do
@data[a]
end
end end
end end
end end
......
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