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 = {}) ⇒ 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.
82 83 84 85 |
# File 'lib/puppet/parser/scope.rb', line 82 def initialize(parent=nil) super parent @symbols = {} end |
Instance Method Details
#[](name) ⇒ Object
87 88 89 90 |
# File 'lib/puppet/parser/scope.rb', line 87 def [](name) val = @symbols[name] val.nil? && !@symbols.include?(name) ? super : val end |
#[]=(name, value) ⇒ Object
96 97 98 |
# File 'lib/puppet/parser/scope.rb', line 96 def []=(name, value) @symbols[name] = value end |
#add_entries_to(target = {}) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/puppet/parser/scope.rb', line 112 def add_entries_to(target = {}) super @symbols.each do |k, v| if v == :undef || v.nil? target.delete(k) else target[ k ] = v end end target end |
#bound?(name) ⇒ Boolean
108 109 110 |
# File 'lib/puppet/parser/scope.rb', line 108 def bound?(name) @symbols.include?(name) end |
#delete(name) ⇒ Object
104 105 106 |
# File 'lib/puppet/parser/scope.rb', line 104 def delete(name) @symbols.delete(name) end |
#include?(name) ⇒ Boolean
100 101 102 |
# File 'lib/puppet/parser/scope.rb', line 100 def include?(name) bound?(name) || super end |
#is_local_scope? ⇒ Boolean
92 93 94 |
# File 'lib/puppet/parser/scope.rb', line 92 def is_local_scope? true end |