Class: Puppet::Parser::Functions::AutoloaderDelegate

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/parser/functions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAutoloaderDelegate

Returns a new instance of AutoloaderDelegate.



37
38
39
# File 'lib/puppet/parser/functions.rb', line 37

def initialize
  @delegatee = Puppet::Util::Autoload.new(self, "puppet/parser/functions")
end

Instance Attribute Details

#delegateeObject (readonly)



35
36
37
# File 'lib/puppet/parser/functions.rb', line 35

def delegatee
  @delegatee
end

Instance Method Details

#load(name, env = Puppet.lookup(:current_environment)) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/puppet/parser/functions.rb', line 49

def load(name, env = Puppet.lookup(:current_environment))
  if Puppet[:strict] != :off
    Puppet.warn_once('deprecations', "Puppet::Parser::Functions#load('#{name}')", _("The method 'Puppet::Parser::Functions.autoloader#load(\"%{name}\")' is deprecated in favor of using 'Scope#call_function'.") % {name: name})
  end

  @delegatee.load(name, env)
end

#loadall(env = Puppet.lookup(:current_environment)) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/puppet/parser/functions.rb', line 41

def loadall(env = Puppet.lookup(:current_environment))
  if Puppet[:strict] != :off
    Puppet.warn_once('deprecations', 'Puppet::Parser::Functions#loadall', _("The method 'Puppet::Parser::Functions.autoloader#loadall' is deprecated in favor of using 'Scope#call_function'."))
  end

  @delegatee.loadall(env)
end

#loaded?(name) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
61
62
63
# File 'lib/puppet/parser/functions.rb', line 57

def loaded?(name)
  if Puppet[:strict] != :off
    Puppet.warn_once('deprecations', "Puppet::Parser::Functions.loaded?('#{name}')", _("The method 'Puppet::Parser::Functions.autoloader#loaded?(\"%{name}\")' is deprecated in favor of using 'Scope#call_function'.") % {name: name})
  end

  @delegatee.loaded?(name)
end