Class: Puppet::Parser::Scope::LocalScope

Inherits:
Ephemeral show all
Defined in:
lib/puppet/parser/scope.rb

Overview

API:

  • public

Instance Attribute Summary

Attributes inherited from Ephemeral

#parent

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ LocalScope

Returns a new instance of LocalScope.

API:

  • public



81
82
83
84
# File 'lib/puppet/parser/scope.rb', line 81

def initialize(parent=nil)
  super parent
  @symbols = {}
end

Instance Method Details

#[](name) ⇒ Object

API:

  • public



86
87
88
89
90
91
92
# File 'lib/puppet/parser/scope.rb', line 86

def [](name)
  if @symbols.include?(name)
    @symbols[name]
  else
    super
  end
end

#[]=(name, value) ⇒ Object

API:

  • public



98
99
100
# File 'lib/puppet/parser/scope.rb', line 98

def []=(name, value)
  @symbols[name] = value
end

#add_entries_to(target = {}) ⇒ Object

API:

  • public



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/puppet/parser/scope.rb', line 114

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

API:

  • public

Returns:



110
111
112
# File 'lib/puppet/parser/scope.rb', line 110

def bound?(name)
  @symbols.include?(name)
end

#delete(name) ⇒ Object

API:

  • public



106
107
108
# File 'lib/puppet/parser/scope.rb', line 106

def delete(name)
  @symbols.delete(name)
end

#include?(name) ⇒ Boolean

API:

  • public

Returns:



102
103
104
# File 'lib/puppet/parser/scope.rb', line 102

def include?(name)
  bound?(name) || super
end

#is_local_scope?Boolean

API:

  • public

Returns:



94
95
96
# File 'lib/puppet/parser/scope.rb', line 94

def is_local_scope?
  true
end