struct Tabular::Tablet
inherits Struct
#
Represents a parameter whose name and aliases may be suggested and matched during tab completion.
Constants#
Constructors#
.new(kind : Kind, name : String = "", aliases = [] of String, help = "", directives : Directable | Nil = nil, delimiters = Tabular.delimiters, repeatable : Bool = false)#
Create a new Tablet.
- kind: See
#kind. - name: See
#name. - aliases: See
#aliases. - help: See
#help. - directives: See
#directives. - delimiters: Ad hoc delimiters that will override
Habit#delimiters.
Methods#
#candidate(word : String, prefix : String = "", & : String -> )#
Yield suggestions for any names that contain word.
#delimits?(word : String) : Bool#
Return true if word is a delimited match of any names.
#match!(word : String)#
Returns self if word is an exact match of any names. Otherwise, raise Error::Match.
#next#
For an Option-flavoured Tablet with #form?, yield the next
Argument-flavoured Tablet to the specified &block.
#to_prefix(word : String) : Tuple(String, String)#
Return the specified word and possible prefix, if delimited.