Sha256: d7cb6d25c3ddcc2973cfef933ee41f1d535a506b53f92a229266d73273c9ef3a

Contents?: true

Size: 509 Bytes

Versions: 32

Compression:

Stored size: 509 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

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/functions/return.rb
puppet-8.10.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.10.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.10.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.9.0 lib/puppet/functions/return.rb
puppet-8.9.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.9.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.9.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.8.1 lib/puppet/functions/return.rb
puppet-8.8.1-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.8.1-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.8.1-universal-darwin lib/puppet/functions/return.rb
puppet-8.7.0 lib/puppet/functions/return.rb
puppet-8.7.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.7.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.7.0-universal-darwin lib/puppet/functions/return.rb
puppet-8.6.0 lib/puppet/functions/return.rb
puppet-8.6.0-x86-mingw32 lib/puppet/functions/return.rb
puppet-8.6.0-x64-mingw32 lib/puppet/functions/return.rb
puppet-8.6.0-universal-darwin lib/puppet/functions/return.rb