Server IP : 111.118.215.189 / Your IP : 18.216.95.250 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/ruby/vendor_ruby/puppet/parser/functions/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
# Called within a class definition, establishes a containment # relationship with another class Puppet::Parser::Functions::newfunction( :contain, :arity => -2, :doc => "Contain one or more classes inside the current class. If any of these classes are undeclared, they will be declared as if called with the `include` function. Accepts a class name, an array of class names, or a comma-separated list of class names. A contained class will not be applied before the containing class is begun, and will be finished before the containing class is finished. When the future parser is used, you must use the class's full name; relative names are no longer allowed. In addition to names in string form, you may also directly use Class and Resource Type values that are produced by the future parser's resource and relationship expressions. " ) do |classes| scope = self # Make call patterns uniform and protected against nested arrays, also make # names absolute if so desired. classes = transform_and_assert_classnames(classes.is_a?(Array) ? classes.flatten : [classes]) containing_resource = scope.resource # This is the same as calling the include function but faster and does not rely on the include # function (which is a statement) to return something (it should not). (compiler.evaluate_classes(classes, self, false) || []).each do |resource| if ! scope.catalog.edge?(containing_resource, resource) scope.catalog.add_edge(containing_resource, resource) end end end