Sha256: 25c33259f9cfa3de516b3c0d6489112baec34747faeb9592d79eb1caa73b9950

Contents?: true

Size: 840 Bytes

Versions: 264

Compression:

Stored size: 840 Bytes

Contents

# The AST object for the parameters inside resource expressions
#
class Puppet::Parser::AST::ResourceParam < Puppet::Parser::AST::Branch
  attr_accessor :value, :param, :add

  def initialize(argshash)
    Puppet.warn_once('deprecations', 'AST::ResourceParam', _('Use of Puppet::Parser::AST::ResourceParam is deprecated and not fully functional'))
    super(argshash)
  end

  def each
    [@param, @value].each { |child| yield child }
  end

  # Return the parameter and the value.
  def evaluate(scope)
    value = @value.safeevaluate(scope)
    return Puppet::Parser::Resource::Param.new(
      :name   => @param,
      :value  => value.nil? ? :undef : value,
      :source => scope.source, 
      :line   => self.line,
      :file   => self.file,
      :add    => self.add
    )
  end

  def to_s
    "#{@param} => #{@value}"
  end
end

Version data entries

264 entries across 264 versions & 1 rubygems

Version Path
puppet-7.21.0 lib/puppet/parser/ast/resourceparam.rb
puppet-7.21.0-x86-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.21.0-x64-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.21.0-universal-darwin lib/puppet/parser/ast/resourceparam.rb
puppet-7.20.0 lib/puppet/parser/ast/resourceparam.rb
puppet-7.20.0-x86-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.20.0-x64-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.20.0-universal-darwin lib/puppet/parser/ast/resourceparam.rb
puppet-7.19.0 lib/puppet/parser/ast/resourceparam.rb
puppet-7.19.0-x86-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.19.0-x64-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.19.0-universal-darwin lib/puppet/parser/ast/resourceparam.rb
puppet-7.18.0 lib/puppet/parser/ast/resourceparam.rb
puppet-7.18.0-x86-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-7.18.0-x64-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-6.28.0 lib/puppet/parser/ast/resourceparam.rb
puppet-7.18.0-universal-darwin lib/puppet/parser/ast/resourceparam.rb
puppet-6.28.0-x86-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-6.28.0-x64-mingw32 lib/puppet/parser/ast/resourceparam.rb
puppet-6.28.0-universal-darwin lib/puppet/parser/ast/resourceparam.rb