Class: Puppet::Pops::Binder::Producers::FirstFoundProducer

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

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) ⇒ FirstFoundProducer

Returns a new instance of FirstFoundProducer.

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)


268
269
270
271
272
273
# File 'lib/puppet/pops/binder/producers.rb', line 268

def initialize(injector, binding, scope, options)
  super
  @producers = options[:producers]
  raise ArgumentError, "Option :producers' must be set to a list of producers." if @producers.nil?
  raise ArgumentError, "Given 'producers' option is not an Array" unless @producers.is_a?(Array)
end

Instance Attribute Details

#producersObject (readonly)



259
260
261
# File 'lib/puppet/pops/binder/producers.rb', line 259

def producers
  @producers
end