Method: Puppet::Pops::Types::PObjectType::PAnnotatedMember#create_dispatch

Defined in:
lib/puppet/pops/types/p_object_type.rb

#create_dispatch(instance) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



262
263
264
265
266
267
268
269
270
271
# File 'lib/puppet/pops/types/p_object_type.rb', line 262

def create_dispatch(instance)
  # TODO: Assumes Ruby implementation for now
  if callable_type.is_a?(PVariantType)
    callable_type.types.map do |ct|
      Functions::Dispatch.new(ct, RubyGenerator.protect_reserved_name(name), [], false, ct.block_type.nil? ? nil : 'block')
    end
  else
    [Functions::Dispatch.new(callable_type, RubyGenerator.protect_reserved_name(name), [], false, callable_type.block_type.nil? ? nil : 'block')]
  end
end