class Puppet::Context::EmptyStack

Base case for Puppet::Context::Stack.

@api private

Public Instance Methods

bindings() click to toggle source

Return the bindings table, which is always empty here

@api private

    # File lib/puppet/context.rb
135 def bindings
136   {}
137 end
lookup(name, &block) click to toggle source

Lookup a binding. Since there are none in EmptyStack, this always raises an exception unless a block is passed, in which case the block is called and its return value is used.

@api private

    # File lib/puppet/context.rb
108 def lookup(name, &block)
109   if block
110     block.call
111   else
112     raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
113   end
114 end
pop() click to toggle source

Base case of pop always raises an error since this is the bottom

@api private

    # File lib/puppet/context.rb
119 def pop
120   raise(StackUnderflow,
121         _('Attempted to pop, but already at root of the context stack.'))
122 end
push(overrides, description = '') click to toggle source

Push bindings onto the stack by creating a new Stack object with `self` as the parent

@api private

    # File lib/puppet/context.rb
128 def push(overrides, description = '')
129   Puppet::Context::Stack.new(self, overrides, description)
130 end