Puppet Function: extlib::dump_params
- Defined in:
-
lib/puppet/functions/extlib/dump_params.rb
- Function type:
- Ruby 4.x API
Summary
this function is used to get a list of parameters passed to or resource.
Overview
extlib::dump_params(Optional[Array[String[1]]] $filter_keys) ⇒ Any
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/puppet/functions/extlib/dump_params.rb', line 23
Puppet::Functions.create_function(:'extlib::dump_params', Puppet::Functions::InternalFunction) do
dispatch :dump_params do
scope_param
optional_param 'Array[String[1]]', :filter_keys
end
def dump_params(scope, filter_keys = ['name'])
scope.resource.to_hash.transform_keys(&:to_s).reject { |k, _v| filter_keys.include?(k) }
end
end
|