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.



39
40
41
# File 'lib/puppet/parser/functions.rb', line 39

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

Instance Attribute Details

#delegateeObject (readonly)



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

def delegatee
  @delegatee
end

Instance Method Details

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



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

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



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

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)


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

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