Sha256: 2b719daad3ef6e3c085154ce7569dd6702f686db82e8b3a996c2955d01c86634

Contents?: true

Size: 608 Bytes

Versions: 50

Compression:

Stored size: 608 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 3.7.0
- note requires future parser
DOC
) do |args|
  function_fail(["with() is only available when parser/evaluator future is in effect"])
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
puppet-3.8.3 lib/puppet/parser/functions/with.rb
puppet-3.8.3-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.8.3-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-retrospec-0.8.0 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/with.rb
puppet-3.8.2 lib/puppet/parser/functions/with.rb
puppet-3.8.2-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.8.2-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-retrospec-0.7.3 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/with.rb
puppet-retrospec-0.7.2 vendor/gems/puppet-3.7.3/lib/puppet/parser/functions/with.rb
puppet-3.8.1 lib/puppet/parser/functions/with.rb
puppet-3.8.1-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.8.1-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.7.5 lib/puppet/parser/functions/with.rb
puppet-3.7.5-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.7.5-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.7.4 lib/puppet/parser/functions/with.rb
puppet-3.7.4-x86-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.7.4-x64-mingw32 lib/puppet/parser/functions/with.rb
puppet-3.7.3 lib/puppet/parser/functions/with.rb
puppet-3.7.3-x86-mingw32 lib/puppet/parser/functions/with.rb