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