class Term::Prompt::EnumList
- Term::Prompt::EnumList
- Reference
- Object
Defined in:
prompt/enum_list.crConstant Summary
-
PAGE_HELP =
"(Press tab/right or left to reveal more choices)"
Constructors
-
.new(prompt : Term::Prompt, **options)
Create instance of EnumList menu.
Instance Method Summary
-
#answer
Find value for the choice selected
-
#call(question : Nil | String, possibilities, &block : EnumList -> )
Call the list menu by passing question and choices
-
#call(question, possibilities)
ditto
-
#choice(*value, &block)
Add a single choice
- #choices : Choices
-
#choices=(values)
Add multiple choices
- #default : Int32
- #default=(default : Int32)
-
#default?
Check if default value is set
- #done : Bool
-
#error_message
Error message when incorrect index chosen
- #failure : Bool
- #input : String | Nil
- #keyenter
- #keyleft
- #keypress(key, event)
- #keyreturn
- #keyright
-
#mark_choice_as_active
Find active choice or set to default
- #page_help : String
- #page_help=(page_help : String)
-
#page_help_message
Pagination help message
- #page_size : Int32
- #page_size=(page_size : Int32)
-
#paginated?
Check if list is paginated
- #prefix : String
- #prefix=(prefix : String)
-
#question_lines_count(question_lines)
Count how many screen lines the question spans
-
#refresh(lines)
Determine area of the screen to clear
-
#render
Render a selection list.
-
#render_error
Render error message and return cursor to position of input
-
#render_footer
Render footer for the indexed menu
-
#render_header
Render chosen option
-
#render_menu
Render menu with indexed choices to select from
-
#render_page_help
Render page help
-
#render_question
Render question with the menu options
- #separator : String
- #separator=(separator : String)
-
#setup_defaults
Setup default option and active selection
- #symbols : Hash(Symbol, String)
-
#symbols=(new_symbols)
Change symbols used by this prompt
-
#validate_defaults
Validate default indexes to be within range
Constructor Detail
Instance Method Detail
Call the list menu by passing question and choices