Class: Puppet::Parser::Scope::LocalScope
- Defined in:
- lib/puppet/parser/scope.rb
Instance Attribute Summary
Attributes inherited from Ephemeral
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, value) ⇒ Object
- #add_entries_to(target = {}, include_undef = false) ⇒ Object
- #bound?(name) ⇒ Boolean
- #delete(name) ⇒ Object
- #include?(name) ⇒ Boolean
-
#initialize(parent = nil) ⇒ LocalScope
constructor
A new instance of LocalScope.
- #is_local_scope? ⇒ Boolean
Constructor Details
#initialize(parent = nil) ⇒ LocalScope
Returns a new instance of LocalScope.
79 80 81 82 |
# File 'lib/puppet/parser/scope.rb', line 79 def initialize(parent=nil) super parent @symbols = {} end |
Instance Method Details
#[](name) ⇒ Object
84 85 86 87 |
# File 'lib/puppet/parser/scope.rb', line 84 def [](name) val = @symbols[name] val.nil? && !@symbols.include?(name) ? super : val end |
#[]=(name, value) ⇒ Object
93 94 95 |
# File 'lib/puppet/parser/scope.rb', line 93 def []=(name, value) @symbols[name] = value end |
#add_entries_to(target = {}, include_undef = false) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/puppet/parser/scope.rb', line 109 def add_entries_to(target = {}, include_undef = false) super @symbols.each do |k, v| if (v == :undef || v.nil?) && !include_undef target.delete(k) else target[ k ] = v end end target end |
#bound?(name) ⇒ Boolean
105 106 107 |
# File 'lib/puppet/parser/scope.rb', line 105 def bound?(name) @symbols.include?(name) end |
#delete(name) ⇒ Object
101 102 103 |
# File 'lib/puppet/parser/scope.rb', line 101 def delete(name) @symbols.delete(name) end |
#include?(name) ⇒ Boolean
97 98 99 |
# File 'lib/puppet/parser/scope.rb', line 97 def include?(name) bound?(name) || super end |
#is_local_scope? ⇒ Boolean
89 90 91 |
# File 'lib/puppet/parser/scope.rb', line 89 def is_local_scope? true end |