Created
November 2, 2018 15:14
-
-
Save hlindberg/015c433af4a835352ccdc3aeeaa1c2a0 to your computer and use it in GitHub Desktop.
Example: Puppet function calling new to create a Boolean from a String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet::Functions.create_function(:any2bool) do | |
dispatch :any2bool do | |
param 'Any', :to_be_converted | |
end | |
def any2bool(to_be_converted) | |
call_function('new', Puppet::Pops::Types::PBooleanType::DEFAULT, to_be_converted) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment