Class Puppet::Parser::AST::VarDef
In: lib/puppet/parser/ast/vardef.rb
Parent: AST::Branch

Define a variable. Stores the value in the current scope.

Methods

each   evaluate  

Attributes

append  [RW] 
name  [RW] 
value  [RW] 

Public Instance methods

[Source]

    # File lib/puppet/parser/ast/vardef.rb, line 21
21:         def each
22:             [@name,@value].each { |child| yield child }
23:         end

Look up our name and value, and store them appropriately. The lexer strips off the syntax stuff like ’$’.

[Source]

    # File lib/puppet/parser/ast/vardef.rb, line 12
12:         def evaluate(scope)
13:             name = @name.safeevaluate(scope)
14:             value = @value.safeevaluate(scope)
15: 
16:             parsewrap do
17:                 scope.setvar(name,value, @file, @line, @append)
18:             end
19:         end

[Validate]