Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gauss:~ brian$ irb
- >> require 'singleton'
- => true
- >> class F
- >> include Singleton
- >> attr_accessor :foo
- >> end
- => nil
- >> f = F.instance
- => #<F:0x116b2b8>
- >> g = F.instance
- => #<F:0x116b2b8>
- >> f.equal?g
- => true
- >> f.foo = 5
- => 5
- >> g.foo
- => 5
Add Comment
Please, Sign In to add comment