class Term::Prompt::Question

Overview

A class responsible for gathering user input

Included Modules

Direct Known Subclasses

Defined in:

prompt/question.cr
prompt/question/validators.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(prompt : Term::Prompt, **options) #

[View source]

Instance Method Detail

def call(message : Nil | String = "", &block : self -> ) #

Call the question.


[View source]
def call(message = "") #

ditto


[View source]
def convert_result(value) #

[View source]
def default : String? #

[View source]
def default? #

[View source]
def echo : Bool #

[View source]
def echo=(echo : Bool) #

[View source]
def echo? : Bool #

[View source]
def errors : Array(String) #

[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def palette : Palette #

[View source]
def palette=(palette : Palette) #

[View source]
def prefix : String #

[View source]
def prefix=(prefix : String) #

[View source]
def process_input(question) #

Decide how to handle input from user


[View source]
def question : String | Nil #

[View source]
def read_input(question) #

[View source]
def refresh(lines, lines_to_clear) #

Determine area of the screen to clear


[View source]
def render #

Read answer and convert to type


[View source]
def render_error(errors) #

[View source]
def render_warning(warnings) #

[View source]
def to_s(io) #

[View source]
def validators : Array(Validator | ValidatorProc) #

[View source]
def value : String | Nil #

[View source]
def warnings : Array(String) #

[View source]