| Class | Puppet::Parser::Scope |
| In: |
lib/puppet/parser/scope.rb
|
| Parent: | Object |
| AST | = | Puppet::Parser::AST |
| base | [RW] | |
| compiler | [RW] | |
| keyword | [RW] | |
| level | [RW] | |
| namespaces | [R] | |
| parent | [RW] | |
| resource | [RW] | |
| source | [RW] | |
| top | [RW] | |
| translated | [RW] |
Return the scope associated with a class. This is just here so that subclasses can set their parent scopes to be the scope of their parent class, and it‘s also used when looking up qualified variables.
Store the fact that we‘ve evaluated a class, and store a reference to the scope in which it was evaluated, so that we can look it up later.
Collect all of the defaults set at any higher scopes. This is a different type of lookup because it‘s additive — it collects all of the defaults, with defaults in closer scopes overriding those in later scopes.
Look up a variable. The simplest value search we do. Default to returning an empty string for missing values, but support returning a constant.
Return the list of scopes up to the top scope, ordered with our own first. This is used for looking up variables and defaults.
Set defaults for a type. The typename should already be downcased, so that the syntax is isolated. We don‘t do any kind of type-checking here; instead we let the resource do it when the defaults are used.
Set a variable in the current scope. This will override settings in scopes above, but will not allow variables in the current scope to be reassigned.