Method: HighLine::Menu#select
- Defined in:
- lib/highline/menu.rb
#select(highline_context, selection, details = nil) ⇒ nil, Object
This method processes the auto-completed user selection, based on the rules for this Menu object. If an action was provided for the selection, it will be executed as described in #choice.
408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/highline/menu.rb', line 408 def select(highline_context, selection, details = nil) # add in any hidden menu commands items = all_items # Find the selected action. selected_item = find_item_from_selection(items, selection) # Run or return it. @highline = highline_context value_for_selected_item(selected_item, details) end |