class Button def pushed endendbuttonA = Button.newdef buttonA.pushed puts "BBB"endbuttonB = Button.newdef buttonB.pushed puts "AAA"endButton.new.pushed#buttonA.pushed# BBBbuttonB.pushed# AAA