Class: Quit
Instance Method Summary collapse
-
#initialize(x, y, window) ⇒ Quit
constructor
A new instance of Quit.
- #on_enter ⇒ Object
Methods inherited from MenuItem
#button_down, #draw, #select, #unselect
Constructor Details
#initialize(x, y, window) ⇒ Quit
Returns a new instance of Quit.
64 65 66 67 |
# File 'lib/menuitem.rb', line 64 def initialize(x, y, window) super(x, y, window) @text = 'Quit' end |
Instance Method Details
#on_enter ⇒ Object
69 70 71 |
# File 'lib/menuitem.rb', line 69 def on_enter @window.close end |