class

Term2::ProgramOptions

Inherits Reference < Object

Container for multiple program options.

options = Term2::ProgramOptions.new(
  Term2::WithAltScreen.new,
  Term2::WithMouseAllMotion.new
)

# Or build incrementally
options = Term2::ProgramOptions.new
options.add(Term2::WithAltScreen.new)
options.add(Term2::WithFPS.new(30.0))

Constructors

new(*options : ProgramOption)
Source

Instance methods

add(option : ProgramOption) : self

Add an option to the collection.

Source
apply(program : Program) : Nil

Apply all options to a program instance.

Source
get_options(option_type : ProgramOption.class) : Array(ProgramOption)

Get all options of a specific type.

Source
has_option?(option_type : ProgramOption.class) : Bool

Check if an option of a specific type is present.

Source