Sha256: d1f6cc11fec0e6d7d06e12fbc925d45655a7d58b030544e254a976ecc52d42bb

Contents?: true

Size: 687 Bytes

Versions: 447

Compression:

Stored size: 687 Bytes

Contents

# Returns the values of a hash as an Array
#
# @example Using `values`
#
# ```puppet
# $hsh = {"apples" => 3, "oranges" => 4 }
# $hsh.values()
# values($hsh)
# # both results in the array [3, 4]
# ```
#
# * Note that a hash in the puppet language accepts any data value (including `undef`) unless
#   it is constrained with a `Hash` data type that narrows the allowed data types.
# * For an empty hash, an empty array is returned.
# * The order of the values is the same as the order in the hash (typically the order in which they were added).
#
Puppet::Functions.create_function(:values) do
  dispatch :values do
    param 'Hash', :hsh
  end

  def values(hsh)
    hsh.values
  end
end

Version data entries

447 entries across 447 versions & 2 rubygems

Version Path
puppet-7.34.0 lib/puppet/functions/values.rb
puppet-7.34.0-x86-mingw32 lib/puppet/functions/values.rb
puppet-7.34.0-x64-mingw32 lib/puppet/functions/values.rb
puppet-7.34.0-universal-darwin lib/puppet/functions/values.rb
puppet-7.33.0 lib/puppet/functions/values.rb
puppet-7.33.0-x86-mingw32 lib/puppet/functions/values.rb
puppet-7.33.0-x64-mingw32 lib/puppet/functions/values.rb
puppet-7.33.0-universal-darwin lib/puppet/functions/values.rb
puppet-7.32.1 lib/puppet/functions/values.rb
puppet-7.32.1-x86-mingw32 lib/puppet/functions/values.rb
puppet-7.32.1-x64-mingw32 lib/puppet/functions/values.rb
puppet-7.32.1-universal-darwin lib/puppet/functions/values.rb
puppet-7.31.0 lib/puppet/functions/values.rb
puppet-7.31.0-x86-mingw32 lib/puppet/functions/values.rb
puppet-7.31.0-x64-mingw32 lib/puppet/functions/values.rb
puppet-7.31.0-universal-darwin lib/puppet/functions/values.rb
puppet-7.30.0 lib/puppet/functions/values.rb
puppet-7.30.0-x86-mingw32 lib/puppet/functions/values.rb
puppet-7.30.0-x64-mingw32 lib/puppet/functions/values.rb
puppet-7.30.0-universal-darwin lib/puppet/functions/values.rb