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.



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

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

Instance Attribute Details

#parentObject (readonly)



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

def parent
  @parent
end

Instance Method Details

#[](name) ⇒ Object



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

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

#add_entries_to(target = {}) ⇒ Object



73
74
75
76
77
# File 'lib/puppet/parser/scope.rb', line 73

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)


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

def bound?(name)
  false
end

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#is_local_scope?Boolean

Returns:

  • (Boolean)


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

def is_local_scope?
  false
end