fork download
  1. class Tree
  2.  
  3. end
  4.  
  5. module TreeStuff
  6. def initialize(data);
  7. @data = data;
  8. end;
  9. def toString;
  10. puts "@data"
  11. end;
  12. end
  13.  
  14. class TreeItem;
  15. include TreeStuff;
  16. def initialize(data)
  17. puts "Error: WRONG!"
  18. end;
  19. def toString;
  20. print "Error: WRONG!";
  21. end;
  22. end;
  23.  
  24.  
  25. class NumericTreeItem < TreeItem
  26. include TreeStuff;
  27. end
  28.  
  29. class StringTreeItem < TreeItem
  30. include TreeStuff;
  31. end
Success #stdin #stdout 0.01s 7460KB
stdin
Standard input is empty
stdout
Standard output is empty