X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fdifference.rb;h=49e86737141f57a1d7d787879d287b36431e9bf9;hp=360c1e307a1a1034b882a1b0a676eb29900b1de7;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb index 360c1e307..49e867371 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb @@ -3,20 +3,24 @@ # module Puppet::Parser::Functions newfunction(:difference, :type => :rvalue, :doc => <<-DOC - This function returns the difference between two arrays. + @summary + This function returns the difference between two arrays. + The returned array is a copy of the original array, removing any items that also appear in the second array. - *Examples:* - - difference(["a","b","c"],["b","c","d"]) + @example Example usage - Would return: ["a"] + difference(["a","b","c"],["b","c","d"]) + Would return: `["a"]` - Note: Since Puppet 4 the minus (-) operator in the Puppet language does the same thing: + > *Note:* + Since Puppet 4 the minus (-) operator in the Puppet language does the same thing: + ['a', 'b', 'c'] - ['b', 'c', 'd'] + Would return: `['a']` - ['a', 'b', 'c'] - ['b', 'c', 'd'] - # would return ['a'] + @return [Array] + The difference between the two given arrays DOC ) do |arguments|