Sha256: 0bd131c3a26cc4fa96c1da573f21acd810eed6587e1c5980ab767fd4771c3b39

Contents?: true

Size: 578 Bytes

Versions: 21

Compression:

Stored size: 578 Bytes

Contents

Puppet::Parser::Functions::newfunction(
  :with,
  :type => :rvalue,
  :arity => -1,
  :doc => <<-DOC
Call a lambda code block with the given arguments. Since the parameters of the lambda
are local to the lambda's scope, this can be used to create private sections
of logic in a class so that the variables are not visible outside of the
class.

Example:

     # notices the array [1, 2, 'foo']
     with(1, 2, 'foo') |$x, $y, $z| { notice [$x, $y, $z] }

- since 4.0.0
DOC
) do |args|
  function_fail(["with() is only available when parser/evaluator future is in effect"])
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
puppet-4.2.3 lib/puppet/parser/functions/with.rb
puppet-4.2.3-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.3-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.2 lib/puppet/parser/functions/with.rb
puppet-4.2.2-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.2-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.1 lib/puppet/parser/functions/with.rb
puppet-4.2.1-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.1-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.0 lib/puppet/parser/functions/with.rb
puppet-4.2.0-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.2.0-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.1.0 lib/puppet/parser/functions/with.rb
puppet-4.1.0-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.1.0-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.0.0 lib/puppet/parser/functions/with.rb
puppet-4.0.0-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.0.0-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-4.0.0.rc1 lib/puppet/parser/functions/with.rb
puppet-4.0.0.rc1-x86-mingw32 lib/puppet/parser/functions/with.rb