lib/puppet/parser/ast/leaf.rb in puppet-0.24.1 vs lib/puppet/parser/ast/leaf.rb in puppet-0.24.2

- old
+ new

@@ -4,11 +4,11 @@ # are simple values, not AST objects. class Leaf < AST attr_accessor :value, :type # Return our value. - def evaluate(hash) + def evaluate(scope) return @value end def to_s return @value @@ -33,18 +33,18 @@ # The base string class. class String < AST::Leaf # Interpolate the string looking for variables, and then return # the result. - def evaluate(hash) - return hash[:scope].strinterp(@value, @file, @line) + def evaluate(scope) + return scope.strinterp(@value, @file, @line) end end # An uninterpreted string. class FlatString < AST::Leaf - def evaluate(hash) + def evaluate(scope) return @value end end # The 'default' option on case statements and selectors. @@ -79,12 +79,12 @@ # A simple variable. This object is only used during interpolation; # the VarDef class is used for assignment. class Variable < Name # Looks up the value of the object in the scope tree (does # not include syntactical constructs, like '$' and '{}'). - def evaluate(hash) + def evaluate(scope) parsewrap do - return hash[:scope].lookupvar(@value) + return scope.lookupvar(@value) end end end end