Puppet Function: to_yaml
- Defined in:
- lib/puppet/functions/to_yaml.rb
- Function type:
- Ruby 4.x API
Overview
}
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet/functions/to_yaml.rb', line 17 Puppet::Functions.create_function(:to_yaml) do # @param data # The data you want to convert to YAML # @param options # A hash of options that will be passed to Ruby's Psych library. Note, this could change between Puppet versions, but at time of writing these are `line_width`, `indentation`, and `canonical`. # # @return [String] The YAML document dispatch :to_yaml do param 'Any', :data optional_param 'Hash', :options end def to_yaml(data, = {}) data.to_yaml(.transform_keys(&:to_sym)) end end |