class

Term::Prompt::EnumList

Inherits Reference / Object

Constants

PAGE_HELP = "(Press tab/right or left to reveal more choices)"

Constructors

new(prompt : Term::Prompt, **options)

Create instance of EnumList menu.

Source

Instance methods

answer

Find value for the choice selected

Source
call(question : Nil | String, possibilities, &block : EnumList -> )

Call the list menu by passing question and choices

Source
call(question, possibilities)

ditto

Source
choice(*value, &block)

Add a single choice

Source
choices
Source
choices=(values)

Add multiple choices

Source
default
Source
default=(default : Int32)
Source
default?

Check if default value is set

Source
done
Source
error_message

Error message when incorrect index chosen

Source
failure
Source
input
Source
keyenter
Source
keyleft
Source
keypress(key, event)
Source
keyreturn
Source
keyright
Source
mark_choice_as_active

Find active choice or set to default

Source
page_help
Source
page_help=(page_help : String)
Source
page_help_message

Pagination help message

Source
page_size
Source
page_size=(page_size : Int32)
Source
paginated?

Check if list is paginated

Source
prefix
Source
prefix=(prefix : String)
Source
question_lines_count(question_lines)

Count how many screen lines the question spans

Source
refresh(lines)

Determine area of the screen to clear

Source
render

Render a selection list.

Source
render_error

Render error message and return cursor to position of input

Source
render_header

Render chosen option

Source
render_menu

Render menu with indexed choices to select from

Source
render_page_help

Render page help

Source
render_question

Render question with the menu options

Source
separator
Source
separator=(separator : String)
Source
setup_defaults

Setup default option and active selection

Source
symbols
Source
symbols=(new_symbols)

Change symbols used by this prompt

Source
validate_defaults

Validate default indexes to be within range

Source