Puppet Function: apply_format

Defined in:
puppet/modules/wmflib/lib/puppet/parser/functions/apply_format.rb
Function type:
Ruby 3.x API

Overview

apply_format()Any

Returns:

  • (Any)


11
12
13
14
15
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/apply_format.rb', line 11

newfunction(:apply_format, :type => :rvalue, :arity => 2) do |args|
  format, *items = args
  fail(ArgumentError, 'apply_format(): a format string is required') unless format.is_a?(String)
  items.flatten.map { |item| format % item }
end