X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fbool2str.rb;h=f55fcd8351645f2fac5cf7c218d85b700abb5cae;hp=be25e0a18d286ec993a28709e02d63dac9228be3;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/bool2str.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/bool2str.rb index be25e0a18..f55fcd835 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/bool2str.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/bool2str.rb @@ -3,29 +3,38 @@ # module Puppet::Parser::Functions newfunction(:bool2str, :type => :rvalue, :doc => <<-DOC - Converts a boolean to a string using optionally supplied arguments. The - optional second and third arguments represent what true and false will be + @summary + Converts a boolean to a string using optionally supplied arguments. + + The optional second and third arguments represent what true and false will be converted to respectively. If only one argument is given, it will be converted from a boolean to a string containing 'true' or 'false'. - *Examples:* + @return + The converted value to string of the given Boolean + + **Examples of usage** - bool2str(true) => 'true' - bool2str(true, 'yes', 'no') => 'yes' - bool2str(false, 't', 'f') => 'f' + ``` + bool2str(true) => 'true' + bool2str(true, 'yes', 'no') => 'yes' + bool2str(false, 't', 'f') => 'f' + ``` Requires a single boolean as an input. - 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. + > *Note:* + 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|