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