We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29b3e90 commit 4cee5f9Copy full SHA for 4cee5f9
lib/puppet/functions/next.rb
@@ -1,8 +1,25 @@
1
# Makes iteration continue with the next value, optionally with a given value for this iteration.
2
# If a value is not given it defaults to `undef`
3
+#
4
+# @example Using the `next()` function
5
#
-# @since 4.7.0
6
+# ```puppet
7
+# $data = ['a','b','c']
8
+# $data.each |Integer $index, String $value| {
9
+# if $index == 1 {
10
+# next()
11
+# }
12
+# notice ("${index} = ${value}")
13
14
+# ```
15
16
+# Would notice:
17
18
+# Notice: Scope(Class[main]): 0 = a
19
+# Notice: Scope(Class[main]): 2 = c
20
21
22
+# @since 4.7.0
23
Puppet::Functions.create_function(:next) do
24
dispatch :next_impl do
25
optional_param 'Any', :value
0 commit comments