4 module Puppet::Parser::Functions
5 newfunction(:assert_private, :doc => <<-DOC
7 Sets the current class or definition as private.
10 set the current class or definition as private.
12 Calling the class or definition from outside the current module will fail.
16 raise(Puppet::ParseError, "assert_private(): Wrong number of arguments given (#{args.size}}) for 0 or 1)") if args.size > 1
19 if scope.lookupvar('module_name') != scope.lookupvar('caller_module_name')
21 if args[0] && args[0].is_a?(String)
24 manifest_name = scope.source.name
25 manifest_type = scope.source.type
26 message = (manifest_type.to_s == 'hostclass') ? 'Class' : 'Definition'
27 message += " #{manifest_name} is private"
29 raise(Puppet::ParseError, message)