Skip to content

struct Tabular::Tablet
inherits Struct #

Represents a parameter whose name and aliases may be suggested and matched during tab completion.

Constants#

NONE = Tablet.new(:none)#

Basically, Tablet? minus the baggage.

Constructors#

.new(kind : Kind, name : String = "", aliases = [] of String, help = "", directives : Directable | Nil = nil, delimiters = Tabular.delimiters, repeatable : Bool = false)#

Create a new Tablet.

View source

Methods#

#aliases#

A list of additional names the Tablet will suggest/match.

View source

#candidate(word : String, & : String -> )#

Yield suggestions for any names that contain word.

View source

#directives#

Additional directives the Tablet will send to the shell if suggested.

View source

#form?#

Return true if a nested form exists.

View source

#help#

The description of the parameter the Tablet represents.

View source

#kind#

The representation of the Tablet.

View source

#match!(word : String)#

Returns self if word is an exact match of any names. Otherwise, raise Error::Match.

View source

#match?(word : String) : Bool#

Return true if word is an exact match of any names.

View source

#name#

The name of the parameter the Tablet represents.

View source

#next#

For an Option-flavoured Tablet with #form?, yield the next Argument-flavoured Tablet to the specified &block.

View source

#repeatable?#

Return true, the Tablet may appear more than once.

View source

#to_s(io : IO)#

Same as #inspect(io).

View source