Skip to content

Instantly share code, notes, and snippets.

@benaskins
Created December 11, 2008 07:18
Show Gist options
  • Save benaskins/34631 to your computer and use it in GitHub Desktop.
Save benaskins/34631 to your computer and use it in GitHub Desktop.
class Foo
attr_accessor :some_attr
def initialize(val)
self.some_attr = val
end
def ==(other)
self.some_attr == other.some_attr
end
end
x = Foo.new(1)
y = Foo.new(1)
z = Foo.new(2)
[x,y,z].uniq # => [x,y,z] :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment