fork 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 # => Child (!!)
Success #stdin #stdout 0.01s 7452KB
stdin
Standard input is empty
stdout
Parent
Child