class Puppet::Pops::Binder::Producers::MultibindProducer

Abstract base class for multibind producers. Is suitable as base class for custom implementations of multibind producers. @abstract @api public

Attributes

contributions_key[R]

Public Instance Methods

type_error_detail(expected, actual) click to toggle source

@param expected [Array<Puppet::Pops::Types::PAnyType>, Puppet::Pops::Types::PAnyType] expected type or types @param actual [Object, Puppet::Pops::Types::PAnyType> the actual value (or its type) @return [String] a formatted string for inclusion as detail in an error message @api private

# File lib/puppet/pops/binder/producers.rb, line 532
def type_error_detail(expected, actual)
  tc = injector.type_calculator
  expected = [expected] unless expected.is_a?(Array)
  actual_t = tc.is_ptype?(actual) ? actual : tc.infer(actual)
  expstrs = expected.collect {|t| tc.string(t) }
  "expected: #{expstrs.join(', or ')}, got: #{tc.string(actual_t)}"
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

@api public

# File lib/puppet/pops/binder/producers.rb, line 522
def initialize(injector, binding, scope, options)
  super
  @contributions_key = injector.key_factory.multibind_contributions(binding.id)
end