Class: Canis::CMenuItem
- Defined in:
- lib/canis/core/util/promptmenu.rb
Overview
A simple way of creating menus that will appear in a single row. This copies the menu at the bottom of “most” upon pressing “:”. hotkey is the key to invoke an item (a single digit letter)
label is an action name
desc is a description displayed after an item is chosen. Usually, its like: + “Folding has been enabled” or “Searches will now be case sensitive”
action may be a Proc or a symbol which will be called if item selected + action may be another menu, so recursive menus can be built, but each + should fit in a line, its a simple system.
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#hotkey ⇒ Object
Returns the value of attribute hotkey.
-
#label ⇒ Object
Returns the value of attribute label.
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
28 29 30 |
# File 'lib/canis/core/util/promptmenu.rb', line 28 def action @action end |
#desc ⇒ Object
Returns the value of attribute desc
28 29 30 |
# File 'lib/canis/core/util/promptmenu.rb', line 28 def desc @desc end |
#hotkey ⇒ Object
Returns the value of attribute hotkey
28 29 30 |
# File 'lib/canis/core/util/promptmenu.rb', line 28 def hotkey @hotkey end |
#label ⇒ Object
Returns the value of attribute label
28 29 30 |
# File 'lib/canis/core/util/promptmenu.rb', line 28 def label @label end |