summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-10-16 09:31:01 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-10-16 09:31:01 +0100
commit2db7440c6798d3ea0bf2f92c66d8281b2bfcff0c (patch)
treebddff86c5d1fc3708583c40c5c79099177bacd16 /README.markdown
parent39126a7bc82797799280231fef7ef9706a113c6c (diff)
parent6de1a6e0622f69ec22c64e72fd53ec12ae8c9111 (diff)
Merge pull request #538 from mmckinst/bool2str_enhance
add functionality to bool2str function
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index d86d91f..f9c9425 100644
--- a/README.markdown
+++ b/README.markdown
@@ -170,6 +170,22 @@ Converts a boolean to a number. Converts values:
* 'true', 't', '1', 'y', and 'yes' to 1.
Requires a single boolean or string as an input. *Type*: rvalue.
+#### `bool2str`
+
+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:*
+~~~
+bool2str(true) => 'true'
+bool2str(true, 'yes', 'no') => 'yes'
+bool2str(false, 't', 'f') => 'f'
+~~~
+
+Requires a single boolean as input. *Type*: rvalue.
+
#### `capitalize`
Capitalizes the first letter of a string or array of strings. Requires either a single string or an array as an input. *Type*: rvalue.