class Puppet::Pops::Binder::Producers::SingletonProducerProducer

Produces the given producer, then uses that producer. @see ProducerProducer for the non singleton version @api public

Attributes

value_producer[R]

@api public

Protected Instance Methods

internal_produce(scope) click to toggle source

@api private

# File lib/puppet/pops/binder/producers.rb, line 399
def internal_produce(scope)
  value_producer.produce(scope)
end

Public Class Methods

new(injector, binding, scope, options) click to toggle source

@param injector [Puppet::Pops::Binder::Injector] The injector where the lookup originates @param binding [Puppet::Pops::Binder::Bindings::Binding, nil] The binding using this producer @param scope [Puppet::Parser::Scope] The scope to use for evaluation @option options [Puppet::Pops::Model::LambdaExpression] :transformer (nil) a transformer of produced value @option options [Puppet::Pops::Model::LambdaExpression] :producer_producer a producer of a value producer (required) @api public

# File lib/puppet/pops/binder/producers.rb, line 389
def initialize(injector, binding, scope, options)
  super
  p = options[:producer_producer]
  raise ArgumentError, "Option :producer_producer must be given in a SingletonProducerProducer" unless p
  @value_producer = p.produce(scope)
end