Permalink
Browse files

Get instance variables instead of using accessor methods

  • Loading branch information...
1 parent 1dd37f2 commit 7353661f9e7a4adefd936ce95b9396e43ee74c67 @sferik committed Oct 18, 2011
@@ -16,7 +16,7 @@ def initialize(direct_message={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
View
@@ -22,7 +22,7 @@ def initialize(list={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
View
@@ -21,7 +21,7 @@ def initialize(photo={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
View
@@ -21,7 +21,7 @@ def initialize(place={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
View
@@ -5,7 +5,7 @@ class Point < Twitter::Base
attr_reader :coordinates
def ==(other)
- super || (other.class == self.class && other.coordinates == self.coordinates)
+ super || (other.class == self.class && other.instance_variable_get('@coordinates'.to_sym) == @coordinates)
end
def latitude
View
@@ -5,7 +5,7 @@ class Polygon < Twitter::Base
attr_reader :coordinates
def ==(other)
- super || (other.class == self.class && other.coordinates == self.coordinates)
+ super || (other.class == self.class && other.instance_variable_get('@coordinates'.to_sym) == @coordinates)
end
end
@@ -7,7 +7,7 @@ class SavedSearch < Twitter::Base
attr_reader :id, :name, :position, :query
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
View
@@ -7,7 +7,7 @@ class Size < Twitter::Base
alias :width :w
def ==(other)
- super || (other.class == self.class && other.height == self.height && other.width == self.width)
+ super || (other.class == self.class && other.instance_variable_get('@h'.to_sym) == @h && other.instance_variable_get('@w'.to_sym) == @w)
end
end
View
@@ -51,7 +51,7 @@ def initialize(status={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end
@@ -15,7 +15,7 @@ def initialize(suggestion={})
end
def ==(other)
- super || (other.class == self.class && other.slug == @slug)
+ super || (other.class == self.class && other.instance_variable_get('@slug'.to_sym) == @slug)
end
end
View
@@ -5,7 +5,7 @@ class Trend < Twitter::Base
attr_reader :events, :name, :promoted_content, :query, :url
def ==(other)
- super || (other.class == self.class && other.name == self.name)
+ super || (other.class == self.class && other.instance_variable_get('@name'.to_sym) == @name)
end
end
View
@@ -98,7 +98,7 @@ def initialize(user={})
end
def ==(other)
- super || (other.class == self.class && other.id == @id)
+ super || (other.class == self.class && other.instance_variable_get('@id'.to_sym) == @id)
end
end

0 comments on commit 7353661

Please sign in to comment.