Puppet Function: stdlib::to_toml
- Defined in:
-
lib/puppet/functions/stdlib/to_toml.rb
- Function type:
- Ruby 4.x API
Summary
Convert a data structure and output to TOML.
Overview
stdlib::to_toml(Hash $data) ⇒ Variant[String, Sensitive[String]]
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/puppet/functions/stdlib/to_toml.rb', line 6
Puppet::Functions.create_function(:'stdlib::to_toml') do
dispatch :to_toml do
required_param 'Hash', :data
return_type 'Variant[String, Sensitive[String]]'
end
def to_toml(data)
call_function('stdlib::rewrap_sensitive_data', data) do |unwrapped_data|
PuppetX::Stdlib::TomlDumper.new(unwrapped_data).toml_str
end
end
end
|