Guest User

Untitled

a guest
Feb 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. class Foo
  2. attr_accessor :some_attr
  3. def initialize(val)
  4. self.some_attr = val
  5. end
  6.  
  7. def hash
  8. self.some_attr.hash
  9. end
  10. end
  11.  
  12. x = Foo.new(1)
  13. y = Foo.new(1)
  14. z = Foo.new(2)
  15.  
  16. [x,y,z].uniq # => [x,z] :)
Add Comment
Please, Sign In to add comment