# class Puppet::Parser::AST::Variable

A simple variable. This object is only used during interpolation; the VarDef class is used for assignment.

### Public Instance Methods

evaluate(scope) click to toggle source

Looks up the value of the object in the scope tree (does not include syntactical constructs, like ‘$’ and ‘{}’).

    # 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() click to toggle source

    # File lib/puppet/parser/ast/leaf.rb, line 124
    def to_s
      "\$#{value}"
    end