- raise(Puppet::ParseError, "bool2str(): Wrong number of arguments " +
- "given (#{arguments.size} for 1)") if arguments.size < 1
+ Note that since Puppet 5.0.0 it is possible to create new data types for almost any
+ datatype using the type system and the built-in
+ [`String.new`](https://puppet.com/docs/puppet/latest/function.html#boolean-to-string)
+ function is used to convert to String with many different format options.
+
+ notice(String(false)) # Notices 'false'
+ notice(String(true)) # Notices 'true'
+ notice(String(false, '%y')) # Notices 'yes'
+ notice(String(true, '%y')) # Notices 'no'
+
+ DOC
+ ) do |arguments|
+
+ unless arguments.size == 1 || arguments.size == 3
+ raise(Puppet::ParseError, "bool2str(): Wrong number of arguments given (#{arguments.size} for 3)")
+ end