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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ Ephemeral

Returns a new instance of Ephemeral.



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

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

Instance Attribute Details

#parentObject (readonly)



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

def parent
  @parent
end

Instance Method Details

#[](name) ⇒ Object



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

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

#add_entries_to(target = {}) ⇒ Object



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

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)


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

def bound?(name)
  false
end

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#is_local_scope?Boolean

Returns:

  • (Boolean)


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

def is_local_scope?
  false
end