struct Bindgen::Util::Tribool
- Bindgen::Util::Tribool
- Struct
- Value
- Object
Overview
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
Defined in:
bindgen/util/tribool.crConstructors
Class Method Summary
Instance Method Summary
-
#==(bool : Bool)
Compares the value to bool.
-
#==(tri : Tribool)
Compares this to the other
Tribool
. -
#false?(default_value : Bool) : Bool
Returns
true
only if this tri-bool isfalse
, or if it is unset and the default_value is. -
#get(default_value : Bool) : Bool
Returns the value as
Bool
. -
#true?(default_value : Bool) : Bool
Returns
true
only if this tri-bool istrue
, or if it is unset and the default_value is. -
#unset?
Returns
true
if this tribool is unset.
Constructor Detail
Class Method Detail
Instance Method Detail
Compares the value to bool. If this tribool is unset, this will never
be true
. See also #unset?
, #true?
and #false?
Returns true
only if this tri-bool is false
, or if it is unset and
the default_value is.
Returns the value as Bool
. If this tri-bool is unset, returns the
default_value. See also #true?
and #false?
.