class

Term::Prompt::Expander

Inherits Reference / Object

A class responsible for rendering expanding options Used by Prompt to display key options question.

Constants

HELP_CHOICE = { key: "h", name: "print help", value: "help", }

Constructors

new(prompt : Term::Prompt, prefix : String = prompt.prefix, default : Int32 = 1, auto_hint : Bool = false, palette : Term::Prompt::Palette = prompt.palette)

Create instance of Expander

Source

Instance methods

auto_hint
Source
call(message : Nil | String, possibilities, &block : self -> )

Execute this prompt

Source
call(message, possibilities)

ditto

Source
choice(*args, **kwargs)

Add a single choice

Source
choices

Get choices

Source
choices(*values)

Add choices

Source
collapsed?
Source
default(value : Int32 = (not_set = true))

Set default value.

Source
default_key
Source
done
Source
expand
Source
expanded?
Source
hint
Source
keyenter

Respond to submit event

Source
keypress(key, event)

Respond to key press event

@api public

Source
keyreturn
Source
palette
Source
prefix
Source
question
Source
read_input
Source
select_choice(key)

Select choice by given key

Source
selected
Source
status
Source

Nested types