Sha256: 83db3be42d098f010eec14fff5c047f6fa7e8a22e13f1ec9af969545591750dc
Contents?: true
Size: 768 Bytes
Versions: 19
Compression:
Stored size: 768 Bytes
Contents
require 'puppet/parser/ast/branch' class Puppet::Parser::AST # Define a variable. Stores the value in the current scope. class VarDef < AST::Branch associates_doc attr_accessor :name, :value, :append @settor = true # Look up our name and value, and store them appropriately. The # lexer strips off the syntax stuff like '$'. def evaluate(scope) value = @value.safeevaluate(scope) if name.is_a?(HashOrArrayAccess) name.assign(scope, value) else name = @name.safeevaluate(scope) parsewrap do scope.setvar(name,value, :file => @file, :line => @line, :append => @append) end end end def each [@name,@value].each { |child| yield child } end end end
Version data entries
19 entries across 19 versions & 1 rubygems