module UpdatePaintModule @updatables = [] @paintables = [] def addUpdatable updatable @updatables.push updatable end def update @updatables.each { |updatable| updatable.update if updatable.respond_to? :update} end def addPaintable printable @paintables.push printable end def paint @paintables.each { |paintable| paintable.paint if paintable.respond_to? :paint} end def addElement(element) @updatables.push element @paintables.push element end end