class

Term::Prompt::List

Inherits Reference / Object

A class responsible for rendering select list menu Used by {Prompt} to display interactive menu.

@api private

Constants

FILTER_KEYS_MATCHER = /\A([[:alnum:]]|[[:punct:]])\Z/

Allowed keys for filter, along with backspace and canc.

HELP = "(Use %s arrow%s keys, press Enter to select%s)"

Constructors

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

Create instance of TTY::Prompt::List menu.

Source

Instance methods

arrows_help

Information about arrow keys

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

Call the list menu by passing question and choices

Source
call(question, possibilities)
Source
choice(*args, **kwargs)

Add a single choice

Source
choices

Get choices

Source
choices(*values)

Add choices

Source
default
Source
default=(value)

Set default option selected

Source
default_help

Default help text

Source
enumerate?

Check if list is enumerated

Source
help
Source
help=(help : String | Nil)
Source
keybackspace
Source
keydelete
Source
keydown
Source
keyleft
Source
keynum(key)
Source
keypress(key, event)
Source
keyreturn
Source
keyright

Moves all choices page by page keeping the current selected item at the same level on each page.

When the choice on a page is outside of next page range then adjust it to the last item, otherwise leave unchanged.

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

Check if list is paginated

Source
paginator

Select paginator based on the current navigation key

Source
search_choice_in(searchable)
Source
separator
Source
separator=(separator : String | Nil)
Source
symbols
Source
symbols=(symbols : Hash(Symbol, String))
Source
sync_paginators

Synchronize paginators start positions

Source