fork(1) download
  1. class Parent
  2. def self.singleton
  3. @@instance ||= new
  4. end
  5. end
  6.  
  7. class Child < Parent
  8. end
  9.  
  10. p Parent.singleton.class # => Parent
  11. p Child.singleton.class # => Parent (!!)
Success #stdin #stdout 0.01s 7408KB
stdin
Standard input is empty
stdout
Parent
Parent