struct

Bindgen::Util::Tribool

Inherits Struct < Value < Object

A tribool can be in one of three states: true, false or unset. Used in Configuration to distinguish an unset (for the default) value from an explicit false.

The user can also use an empty value in the configuration to explicitly use the default.

Use this type in a serializable field like this:

getter my_option = Util::Tribool.unset

Constructors

new(value : Bool | Nil)
Source

Class methods

unset

Returns a new unset Tribool.

Source

Instance methods

==(other : Bool)

Compares the value to the Bool other. If this tribool is unset, this will never be true. See also #unset?, #true? and #false?

Source
==(other : Tribool)

Compares this to the other Tribool.

Source
false?(default_value : Bool) : Bool

Returns true only if this tri-bool is false, or if it is unset and the default_value is.

Source
get(default_value : Bool) : Bool

Returns the value as Bool. If this tri-bool is unset, returns the default_value. See also #true? and #false?.

Source
true?(default_value : Bool) : Bool

Returns true only if this tri-bool is true, or if it is unset and the default_value is. This is semantically a alias for #get.

Source
unset?

Returns true if this tribool is unset.

Source