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
134 def bindings
135   {}
136 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
107 def lookup(name, &block)
108   if block
109     block.call
110   else
111     raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
112   end
113 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
118 def pop
119   raise(StackUnderflow,
120         _('Attempted to pop, but already at root of the context stack.'))
121 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
127 def push(overrides, description = '')
128   Puppet::Context::Stack.new(self, overrides, description)
129 end