Created
February 25, 2013 20:27
-
-
Save zaphod42/5032998 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def lookupvar(name, options = {}) | |
| unless name.is_a? String | |
| raise Puppet::DevError, "Scope variable name is a #{name.class}, not a string" | |
| end | |
| table = ephemeral?(name) ? @ephemeral.last : @symtable | |
| if name =~ /^(.*)::(.+)$/ | |
| class_name = $1 | |
| variable_name = $2 | |
| lookup_qualified_variable(class_name, variable_name, options) | |
| elsif table.include?(name) | |
| table[name] | |
| else | |
| next_scope = inherited_class_scope || enclosing_scope | |
| if next_scope | |
| next_scope.lookupvar(name, options) | |
| else | |
| nil | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment