Class: Puppet::Parser::AST::Variable
- Defined in:
- lib/puppet/parser/ast/leaf.rb
Overview
A simple variable. This object is only used during interpolation; the VarDef class is used for assignment.
Instance Attribute Summary
Attributes inherited from Leaf
Instance Method Summary collapse
-
#evaluate(scope) ⇒ Object
Looks up the value of the object in the scope tree (does not include syntactical constructs, like ‘$’ and ‘{}’).
- #to_s ⇒ Object
Methods inherited from Leaf
Instance Method Details
#evaluate(scope) ⇒ Object
Looks up the value of the object in the scope tree (does not include syntactical constructs, like ‘$’ and ‘{}’).
114 115 116 117 118 119 120 121 122 |
# File 'lib/puppet/parser/ast/leaf.rb', line 114 def evaluate(scope) parsewrap do if scope.include?(@value) scope[@value, {:file => file, :line => line}] else :undef end end end |
#to_s ⇒ Object
124 125 126 |
# File 'lib/puppet/parser/ast/leaf.rb', line 124 def to_s "\$#{value}" end |