Class: Puppet::Parser::AST::ResourceParam
- Inherits:
-
Branch
- Object
- Puppet::Parser::AST
- Branch
- Puppet::Parser::AST::ResourceParam
- Defined in:
- lib/puppet/parser/ast/resourceparam.rb
Overview
The AST object for the parameters inside resource expressions
Constant Summary
Constants inherited from Puppet::Parser::AST
Instance Attribute Summary collapse
Attributes inherited from Branch
Attributes inherited from Puppet::Parser::AST
#file, #line, #parent, #pos, #scope
Instance Method Summary collapse
- #each ⇒ Object
-
#evaluate(scope) ⇒ Object
Return the parameter and the value.
- #to_s ⇒ Object
Methods inherited from Branch
Methods inherited from Puppet::Parser::AST
#initialize, #inspect, #safeevaluate
Methods included from Util::MethodHelper
#requiredopts, #set_options, #symbolize_options
Methods included from Util::Errors
#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail
Constructor Details
This class inherits a constructor from Puppet::Parser::AST::Branch
Instance Attribute Details
Instance Method Details
#each ⇒ Object
6 7 8 |
# File 'lib/puppet/parser/ast/resourceparam.rb', line 6 def each [@param, @value].each { |child| yield child } end |
#evaluate(scope) ⇒ Object
Return the parameter and the value.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/puppet/parser/ast/resourceparam.rb', line 11 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 |
#to_s ⇒ Object
23 24 25 |
# File 'lib/puppet/parser/ast/resourceparam.rb', line 23 def to_s "#{@param} => #{@value.to_s}" end |