Class: Puppet::Parser::AST::Variable
- Defined in:
- lib/vendor/puppet/parser/ast/leaf.rb
Overview
A simple variable. This object is only used during interpolation; the VarDef class is used for assignment.
Constant Summary
Constants inherited from Puppet::Parser::AST
Constants included from Util::Docs
Instance Attribute Summary
Attributes inherited from Leaf
Attributes inherited from Puppet::Parser::AST
Attributes included from Util::Docs
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
Methods inherited from Puppet::Parser::AST
associates_doc, #evaluate_match, #initialize, #inspect, #parsefail, #parsewrap, #safeevaluate, settor?, #use_docs
Methods included from Util::Docs
#desc, #dochook, #doctable, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub
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
Instance Method Details
#evaluate(scope) ⇒ Object
Looks up the value of the object in the scope tree (does not include syntactical constructs, like ‘$’ and ‘{}’).
125 126 127 128 129 130 131 132 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 125 def evaluate(scope) parsewrap do if (var = scope.lookupvar(@value, :file => file, :line => line)) == :undefined var = :undef end var end end |
#to_s ⇒ Object
134 135 136 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 134 def to_s "\$#{value}" end |