class Tree def initialize puts "Make a normal tree" end def decorate puts "Make sure the tree won/'t fall" end end class RedBalls < Tree def initialize(tree) @parent = tree; end def decorate @parent.decorate puts "Put on some red balls" end end class BlueBalls < Tree def initialize(tree) @parent = tree; end def decorate @parent.decorate puts "Add blue balls" end end class Angel < Tree def initialize(tree) @parent = tree; end def decorate @parent.decorate puts "An angel on the top" end end tree = Angel.new(BlueBalls.new(RedBalls.new(Tree.new))) tree.decorate