Sha256: 0b88be3652fee0a65041c52e6475b6bcb676e6d93ab33698f4186c0b0af571c4

Contents?: true

Size: 508 Bytes

Versions: 20

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true
# Makes iteration continue with the next value, optionally with a given value for this iteration.
# If a value is not given it defaults to `undef`
#
# @since 4.7.0
#
Puppet::Functions.create_function(:return, Puppet::Functions::InternalFunction) do
  dispatch :return_impl do
    optional_param 'Any', :value
  end

  def return_impl(value = nil)
    file, line = Puppet::Pops::PuppetStack.top_of_stack
    raise Puppet::Pops::Evaluator::Return.new(value, file, line)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/functions/return.rb
puppet-8.3.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.3.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.3.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.3.1 lib/puppet/functions/return.rb
puppet-8.3.1-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.3.1-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.3.1-universal-darwin lib/puppet/functions/return.rb
puppet-8.2.0 lib/puppet/functions/return.rb
puppet-8.2.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.2.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.2.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.1.0 lib/puppet/functions/return.rb
puppet-8.1.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.1.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.1.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.0.1 lib/puppet/functions/return.rb
puppet-8.0.1-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.0.1-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.0.1-universal-darwin lib/puppet/functions/return.rb