Class: TTY::MenuTree::Group
Overview
An action that, when selected, opens a submenu of child actions rather than performing work itself.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The label shown for this group.
-
#submenu ⇒ Array<#name>
readonly
The child actions.
Instance Method Summary collapse
-
#initialize(name:, actions:) ⇒ Group
constructor
A new instance of Group.
Methods inherited from Action
Constructor Details
#initialize(name:, actions:) ⇒ Group
Returns a new instance of Group.
22 23 24 25 26 |
# File 'lib/tty/menu_tree/group.rb', line 22 def initialize(name:, actions:) super() @name = name @submenu = actions end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns the label shown for this group.
14 15 16 |
# File 'lib/tty/menu_tree/group.rb', line 14 def name @name end |
#submenu ⇒ Array<#name> (readonly)
Returns the child actions.
17 18 19 |
# File 'lib/tty/menu_tree/group.rb', line 17 def @submenu end |