Method: Puppet::Parser::Scope#with_guarded_scope

Defined in:
lib/puppet/parser/scope.rb

#with_guarded_scopeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Execute given block and ensure that ephemeral level is restored

Returns:

  • (Object)

    the return of the block



994
995
996
997
998
999
1000
1001
# File 'lib/puppet/parser/scope.rb', line 994

def with_guarded_scope
  elevel = ephemeral_level
  begin
    yield
  ensure
    pop_ephemerals(elevel)
  end
end