Class: Puppet::Pops::Binder::Producers::LookupProducer

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

Direct Known Subclasses

LookupKeyProducer

Instance Attribute Summary collapse

Attributes inherited from AbstractArgumentedProducer

#binding, #injector

Attributes inherited from Producer

#transformer

Instance Method Summary collapse

Methods inherited from Producer

#produce, #producer

Constructor Details

#initialize(injector, binder, scope, options) ⇒ LookupProducer

Returns a new instance of LookupProducer.

Parameters:

Options Hash (options):

  • :transformer (Model::LambdaExpression) — default: nil

    a transformer of produced value

  • :type (Types::PAnyType)

    The type to lookup

  • :name (String) — default: ''

    The name to lookup

Raises:

  • (ArgumentError)


330
331
332
333
334
335
# File 'lib/puppet/pops/binder/producers.rb', line 330

def initialize(injector, binder, scope, options)
  super
  @type = options[:type]
  @name = options[:name] || ''
  raise ArgumentError, "Option 'type' must be given in a LookupProducer." unless @type
end

Instance Attribute Details

#nameObject (readonly)



320
321
322
# File 'lib/puppet/pops/binder/producers.rb', line 320

def name
  @name
end

#typeObject (readonly)



317
318
319
# File 'lib/puppet/pops/binder/producers.rb', line 317

def type
  @type
end