Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- attr_accessor :some_attr
- def initialize(val)
- self.some_attr = val
- end
- def hash
- self.some_attr.hash
- end
- end
- x = Foo.new(1)
- y = Foo.new(1)
- z = Foo.new(2)
- [x,y,z].uniq # => [x,z] :)
Add Comment
Please, Sign In to add comment