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.



49
50
51
# File 'lib/puppet/parser/scope.rb', line 49

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

Instance Attribute Details

#parentObject (readonly)



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

def parent
  @parent
end

Instance Method Details

#[](name) ⇒ Object



57
58
59
60
61
# File 'lib/puppet/parser/scope.rb', line 57

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

#add_entries_to(target = {}) ⇒ Object



71
72
73
74
75
# File 'lib/puppet/parser/scope.rb', line 71

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

#bound?(name) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/puppet/parser/scope.rb', line 67

def bound?(name)
  false
end

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/puppet/parser/scope.rb', line 63

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

#is_local_scope?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/puppet/parser/scope.rb', line 53

def is_local_scope?
  false
end