Function: require_exclusive_choice

Function: require_exclusive_choice

Usage

 require_exclusive_choice(choices some_strings, some_multiple_choice_value)

Requre that exacttly one of the given choices is selected in a multiple choice value.

This is a combination of require_choice and exclusive_choice.

Parameters

Parameter Type Description
input string Multiple choice value to look update.
choice string Choice to require.
choice1 string Require multiple choices.
choice2 string etc.

Examples

 require_exclusive_choice(choice1: "red", choice2: "green", "red, blue")    ==  "red, blue"
 require_exclusive_choice(choice1: "red", choice2: "green", "red, green")   ==  "red"
 require_exclusive_choice(choice1: "red", choice2: "green", "green, blue")  ==  "green, blue"
 require_exclusive_choice(choice1: "red", choice2: "green", "black, blue")  ==  "black, blue, red"

See also

require_choice Require that at least one of the given choices is selected.
exclusive_choice Require that at most one of the given choices is selected.
remove_choice Remove the given choices from a multiple choice value.