Class: Puppet::Parser::Scope::Ephemeral

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

Overview

Abstract base class for LocalScope and MatchScope

Direct Known Subclasses

LocalScope, MatchScope, ParameterScope

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ Ephemeral

Returns a new instance of Ephemeral


47
48
49
# File 'lib/puppet/parser/scope.rb', line 47

def initialize(parent = nil)
  @parent = parent
end

Instance Attribute Details

#parentObject (readonly)


45
46
47
# File 'lib/puppet/parser/scope.rb', line 45

def parent
  @parent
end

Instance Method Details

#[](name) ⇒ Object


55
56
57
58
59
# File 'lib/puppet/parser/scope.rb', line 55

def [](name)
  if @parent
    @parent[name]
  end
end

#add_entries_to(target = {}, include_undef = false) ⇒ Object


69
70
71
72
73
# File 'lib/puppet/parser/scope.rb', line 69

def add_entries_to(target = {}, include_undef = false)
  @parent.add_entries_to(target, include_undef) unless @parent.nil?
  # do not include match data ($0-$n)
  target
end

#bound?(name) ⇒ Boolean


65
66
67
# File 'lib/puppet/parser/scope.rb', line 65

def bound?(name)
  false
end

#include?(name) ⇒ Boolean


61
62
63
# File 'lib/puppet/parser/scope.rb', line 61

def include?(name)
  (@parent and @parent.include?(name))
end

#is_local_scope?Boolean


51
52
53
# File 'lib/puppet/parser/scope.rb', line 51

def is_local_scope?
  false
end