Skip to content
matrinox edited this page Jan 25, 2016 · 1 revision
menu.confirm = 'Are you sure? (yes or no)' # Setting it will confirm answer with user, displaying the value as prompt
menu.default = 'answer'/'1' # Sets default answer if user hits enter without typing. Must match the exact string of the choice (for numbers, wrap in a string)
menu.echo = true/false # Whether the prompt should echo input
menu.first_answer = 'answer'/'1' # Executes an answer as if the user typed in the string (for numbers, wrap in a string)
menu.flow = :rows, :columns_across, :columns_down, :uneven_columns_across, :uneven_columns_down, :inline # The presentation style of menu options
menu.gather = Integer, String/Regexp, Hash # Will keep asking the same question as it gathers it into an array or hash. See HighLine::Question for more info
menu.header = String # Header text displayed before the options
menu.index = :none, :letter, :number, to_s # The first 3 are the most common options. The last one makes all the indexes the same (might be useful if you want a bulleted list, e.g. '•')
menu.index_suffix = ')' # String to append to index string
menu.layout = :list, :menu_only # 
menu.list_option = String # Only valid when :menu_only is selected (e.g. if list_option=' OR ', then it prints 'item1, item2 OR item3')
menu.select_by = :index_or_name, :index, :name # Let user select by the index, name, or both. Index selection uses the index type. Name selection reduces the options by matching prefix until there's only one; otherwise it display an error to the user

# Maybe more
Clone this wiki locally