Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. gauss:~ brian$ irb
  2. >> require 'singleton'
  3. => true
  4. >> class F
  5. >> include Singleton
  6. >> attr_accessor :foo
  7. >> end
  8. => nil
  9. >> f = F.instance
  10. => #<F:0x116b2b8>
  11. >> g = F.instance
  12. => #<F:0x116b2b8>
  13. >> f.equal?g
  14. => true
  15. >> f.foo = 5
  16. => 5
  17. >> g.foo
  18. => 5
Add Comment
Please, Sign In to add comment