Class: Puppet::Pops::Binder::Producers::SingletonProducerProducer

Inherits:
Producer
  • Object
show all
Defined in:
lib/puppet/pops/binder/producers.rb

Overview

Produces the given producer, then uses that producer.

Instance Attribute Summary collapse

Attributes inherited from Producer

#transformer

Instance Method Summary collapse

Methods inherited from Producer

#produce, #producer

Constructor Details

#initialize(injector, binding, scope, options) ⇒ SingletonProducerProducer

Returns a new instance of SingletonProducerProducer.

Parameters:

  • injector (Injector)

    The injector where the lookup originates

  • binding (Bindings::Binding, nil)

    The binding using this producer

  • scope (Puppet::Parser::Scope)

    The scope to use for evaluation

  • options (Hash)

    a customizable set of options

Options Hash (options):

Raises:

  • (ArgumentError)


392
393
394
395
396
397
# File 'lib/puppet/pops/binder/producers.rb', line 392

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

Instance Attribute Details

#value_producerObject (readonly)



383
384
385
# File 'lib/puppet/pops/binder/producers.rb', line 383

def value_producer
  @value_producer
end