Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / getvar.rb
index fddbd82..41d3c4f 100644 (file)
@@ -3,21 +3,20 @@
 #
 module Puppet::Parser::Functions
   newfunction(:getvar, :type => :rvalue, :doc => <<-'DOC') do |args|
-    Lookup a variable in a given namespace.
-    Returns undef if variable does not exist.
+    @summary
+      Lookup a variable in a given namespace.
 
-    For example:
+    @return
+      undef - if variable does not exist
 
-        $foo = getvar('site::data::foo')
-        # Equivalent to $foo = $site::data::foo
+    @example Example usage
+      $foo = getvar('site::data::foo') # Equivalent to $foo = $site::data::foo
 
-    This is useful if the namespace itself is stored in a string:
+    @example Where namespace is stored in a string
+      $datalocation = 'site::data'
+      $bar = getvar("${datalocation}::bar") # Equivalent to $bar = $site::data::bar
 
-        $datalocation = 'site::data'
-        $bar = getvar("${datalocation}::bar")
-        # Equivalent to $bar = $site::data::bar
-
-    Note: from Puppet 6.0.0, the compatible function with the same name in Puppet core
+    > **Note:** from Puppet 6.0.0, the compatible function with the same name in Puppet core
     will be used instead of this function. The new function also has support for
     digging into a structured value. See the built-in
     [`getvar`](https://puppet.com/docs/puppet/latest/function.html#getvar) function