Class: TTY::MenuTree::ExitAction
- Defined in:
- lib/tty/menu_tree/exit_action.rb
Overview
A ready-made action that ends the top-level menu loop when selected.
Constant Summary collapse
- DEFAULT_NAME =
"Exit"
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The label shown for this action.
Instance Method Summary collapse
-
#call ⇒ void
No-op; selecting this action ends the loop rather than doing work.
- #exit? ⇒ true
-
#initialize(name: DEFAULT_NAME) ⇒ ExitAction
constructor
A new instance of ExitAction.
Methods inherited from Action
Constructor Details
#initialize(name: DEFAULT_NAME) ⇒ ExitAction
Returns a new instance of ExitAction.
18 19 20 21 |
# File 'lib/tty/menu_tree/exit_action.rb', line 18 def initialize(name: DEFAULT_NAME) super() @name = name end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns the label shown for this action.
15 16 17 |
# File 'lib/tty/menu_tree/exit_action.rb', line 15 def name @name end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
No-op; selecting this action ends the loop rather than doing work.
25 |
# File 'lib/tty/menu_tree/exit_action.rb', line 25 def call; end |
#exit? ⇒ true
28 29 30 |
# File 'lib/tty/menu_tree/exit_action.rb', line 28 def exit? true end |