projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git]
/
3rdparty
/
modules
/
stdlib
/
lib
/
puppet
/
functions
/
to_json.rb
diff --git
a/3rdparty/modules/stdlib/lib/puppet/functions/to_json.rb
b/3rdparty/modules/stdlib/lib/puppet/functions/to_json.rb
index
782d695
..
20d39e7
100644
(file)
--- a/
3rdparty/modules/stdlib/lib/puppet/functions/to_json.rb
+++ b/
3rdparty/modules/stdlib/lib/puppet/functions/to_json.rb
@@
-1,4
+1,6
@@
-# Take a data structure and output it as JSON
+require 'json'
+# @summary
+# Convert a data structure and output to JSON
#
# @example how to output JSON
# # output json to a file
#
# @example how to output JSON
# # output json to a file
@@
-7,10
+9,10
@@
# content => to_json($myhash),
# }
#
# content => to_json($myhash),
# }
#
-#
-require 'json'
-
Puppet::Functions.create_function(:to_json) do
Puppet::Functions.create_function(:to_json) do
+ # @param data
+ # data structure which needs to be converted into JSON
+ # @return converted data to json
dispatch :to_json do
param 'Any', :data
end
dispatch :to_json do
param 'Any', :data
end