Skip to content

Commit 1c5f7dc

Browse files
committed
Fix examples location
They must be at the dispatch call.
1 parent 1c943f7 commit 1c5f7dc

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

lib/puppet/functions/to_json.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
require 'json'
44
# @summary
55
# Convert a data structure and output to JSON
6-
#
7-
# @example Output JSON to a file
8-
# file { '/tmp/my.json':
9-
# ensure => file,
10-
# content => to_json($myhash),
11-
# }
12-
#
136
Puppet::Functions.create_function(:to_json) do
147
# @param data
158
# Data structure which needs to be converted into JSON
9+
#
10+
# @example Output JSON to a file
11+
# file { '/tmp/my.json':
12+
# ensure => file,
13+
# content => to_json($myhash),
14+
# }
15+
#
1616
# @return [String] Converted data to JSON
1717
dispatch :to_json do
1818
param 'Any', :data

lib/puppet/functions/to_yaml.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
require 'yaml'
44
# @summary
55
# Convert a data structure and output it as YAML
6-
#
7-
# @example Output YAML to a file
8-
# file { '/tmp/my.yaml':
9-
# ensure => file,
10-
# content => to_yaml($myhash),
11-
# }
12-
# @example Use options to control the output format
13-
# file { '/tmp/my.yaml':
14-
# ensure => file,
15-
# content => to_yaml($myhash, {indentation => 4})
16-
# }
176
Puppet::Functions.create_function(:to_yaml) do
187
# @param data
198
# The data you want to convert to YAML
209
# @param options
2110
# 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`.
2211
#
12+
# @example Output YAML to a file
13+
# file { '/tmp/my.yaml':
14+
# ensure => file,
15+
# content => to_yaml($myhash),
16+
# }
17+
# @example Use options to control the output format
18+
# file { '/tmp/my.yaml':
19+
# ensure => file,
20+
# content => to_yaml($myhash, {indentation => 4})
21+
# }
22+
#
2323
# @return [String] The YAML document
2424
dispatch :to_yaml do
2525
param 'Any', :data

0 commit comments

Comments
 (0)