Class: Puppet::Parser::Scope::Ephemeral
- Defined in:
- lib/vendor/puppet/parser/scope.rb
Overview
thin wrapper around an ephemeral symbol table. when a symbol
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(parent = nil) ⇒ Ephemeral
constructor
A new instance of Ephemeral.
Constructor Details
#initialize(parent = nil) ⇒ Ephemeral
Returns a new instance of Ephemeral.
31 32 33 34 |
# File 'lib/vendor/puppet/parser/scope.rb', line 31 def initialize(parent=nil) @symbols = {} @parent = parent end |
Instance Method Details
#[](name) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/vendor/puppet/parser/scope.rb', line 42 def [](name) unless @symbols.include?(name) or @parent.nil? @parent[name] else @symbols[name] end end |