On Mon, Feb 1, 2016 at 11:48 AM, Trevor Vaughan <[email protected]>
wrote:

> I would *love* to see something like this hit the core language, but there
> are quite a few cases where I have items that can be a Boolean, Number, or
> String (I'm still not loving needing to convert Numbers to Strings
> everywhere for consistency) so it gets difficult to use the Puppet 4
> inbuilt validators.
>

That's where Variants come in:
https://docs.puppetlabs.com/puppet/4.2/reference/lang_data_abstract.html#variant

Variant[Boolean, Number, String] means "must be a Boolean, a Number, or a
String", which sounds like exactly what you want.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CAE%2BtgeMbfHhRC76XJ%2BKz0czJsiazgfadQ%2BJ0oU3%3Di9sKtu_fGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to