diff --git a/lib/twitter/place.rb b/lib/twitter/place.rb index edee12a4a..9bf47f8f9 100644 --- a/lib/twitter/place.rb +++ b/lib/twitter/place.rb @@ -3,7 +3,6 @@ module Twitter class Place < Twitter::Base - include Equalizer.new(:woeid) attr_reader :attributes, :country, :full_name, :name, :woeid alias woe_id woeid object_attr_reader :GeoFactory, :bounding_box @@ -11,6 +10,19 @@ class Place < Twitter::Base alias contained? contained_within? uri_attr_reader :uri + # @param other [Twitter::Place] + # @return [Boolean] + def eql?(other) + super || instance_of?(other.class) && !woeid.nil? && other.respond_to?(:woeid) && woeid.eql?(other.woeid) + end + + # @param other [Twitter::Place] + # @return [Boolean] + def ==(other) + other = coerce(other) if respond_to?(:coerce, true) + super || kind_of?(self.class) && !woeid.nil? && other.respond_to?(:woeid) && woeid == other.woeid + end + # @return [String] def country_code @attrs[:country_code] || @attrs[:countryCode]