Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. ## Class
  2.  
  3. class Foo
  4. attr_accessor :bar
  5. end
  6.  
  7. a = Foo.new
  8. b = a
  9.  
  10. a.bar = "hello"
  11. b.bar = "bye"
  12.  
  13. puts "a == b #{a == b}"
  14. puts "a === b #{a === b}"
  15. puts "a.equal?(b) #{a.equal?(b)}"
  16.  
  17. ## Output
  18.  
  19. a == b true
  20. a === b true
  21. a.equal?(b) true
Add Comment
Please, Sign In to add comment