Method: Puppet::Parser::Scope::ParameterScope#evaluate3x
- Defined in:
- lib/puppet/parser/scope.rb
#evaluate3x(name, expression, scope) ⇒ Object
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.
A parameter default must be evaluated using a special scope. The scope that is given to this method must have a ParameterScope as its last ephemeral scope. This method will then push a MatchScope while the given expression is evaluated. The method will catch any throw of :unevaluated_parameter and produce an error saying that the evaluated parameter X tries to access the unevaluated parameter Y.
195 196 197 198 199 200 201 202 203 |
# File 'lib/puppet/parser/scope.rb', line 195 def evaluate3x(name, expression, scope) scope.with_guarded_scope do bad = catch(:unevaluated_parameter) do scope.new_match_scope(nil) return as_read_only { expression.safeevaluate(scope) } end parameter_reference_failure(name, bad) end end |