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.



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

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

Instance Attribute Details

#parentObject (readonly)



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

def parent
  @parent
end

Instance Method Details

#[](name) ⇒ Object



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

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

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



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

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

Returns:

  • (Boolean)


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

def bound?(name)
  false
end

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#is_local_scope?Boolean

Returns:

  • (Boolean)


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

def is_local_scope?
  false
end