module Puppet::Parser::Methods

A module for handling finding and invoking methods (functions invokable as a method). A method call on the form:

$a.meth(1,2,3] {|...| ...}

will lookup a function called ‘meth’ and call it with the arguments ($a, 1, 2, 3, <lambda>)

@see Puppet::Parser::AST::Lambda @see Puppet::Parser::AST::MethodCall

@api public @since 3.2

Constants

Environment

Public Class Methods

find_method(scope, receiver, name) click to toggle source

Finds a function and returns an instance of Method configured to perform invocation. @return [Method, nil] configured method or nil if method not found

# File lib/puppet/parser/methods.rb, line 63
def self.find_method(scope, receiver, name)
  fname = Puppet::Parser::Functions.function(name)
  rvalue = Puppet::Parser::Functions.rvalue?(name)
  return Method.new(scope, receiver, fname, rvalue) if fname
  nil
end