Class: Puppet::Functions::Function

Inherits:
Pops::Functions::Function show all
Defined in:
lib/puppet/functions.rb

Overview

Function

This class is the base class for all Puppet 4x Function API functions. A specialized class is created for each puppet function.

Direct Known Subclasses

InternalFunction, PuppetFunction

Instance Attribute Summary

Attributes inherited from Pops::Functions::Function

#closure_scope, #loader

Class Method Summary collapse

Methods inherited from Pops::Functions::Function

#call, #call_function, dispatcher, #initialize, signatures

Constructor Details

This class inherits a constructor from Puppet::Pops::Functions::Function

Class Method Details

.builderObject

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.



274
275
276
277
278
# File 'lib/puppet/functions.rb', line 274

def self.builder
  @type_parser ||= Puppet::Pops::Types::TypeParser.new
  @all_callables ||= Puppet::Pops::Types::TypeFactory.all_callables
  DispatcherBuilder.new(dispatcher, @type_parser, @all_callables, loader)
end

.dispatch(meth_name, &block) ⇒ Void

Dispatch any calls that match the signature to the provided method name.



288
289
290
291
292
# File 'lib/puppet/functions.rb', line 288

def self.dispatch(meth_name, &block)
  builder().instance_eval do
    dispatch(meth_name, &block)
  end
end