diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-08 14:25:52 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-08 14:25:52 -0600 |
commit | 5a0e34b4f8da22e1830ec7d0a730c3686665bceb (patch) | |
tree | d8635f754c2a0fee69e103cf6d85792ff4e736a1 /lib/puppet/parser/ast/node.rb | |
parent | 82720d5327b30839a29035ee0b498b940ffc7a5a (diff) | |
download | puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.tar.gz puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.tar.xz puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.zip |
Refactoring the AST classes just a bit. I realized that
all of the evaluate() methods only ever accepted a scope,
and sometimes one other option, so I switched them all to
use named arguments instead of a hash.
Diffstat (limited to 'lib/puppet/parser/ast/node.rb')
-rw-r--r-- | lib/puppet/parser/ast/node.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/puppet/parser/ast/node.rb b/lib/puppet/parser/ast/node.rb index a296e43ba..3c5d44d1b 100644 --- a/lib/puppet/parser/ast/node.rb +++ b/lib/puppet/parser/ast/node.rb @@ -7,23 +7,15 @@ class Puppet::Parser::AST @name = :node attr_accessor :name - def evaluate(options) - scope = options[:scope] - - #pscope = if ! Puppet[:lexical] or options[:asparent] - # @scope - #else - # origscope - #end - + def evaluate(scope, resource) # We don't have to worry about the declarativeness of node parentage, # because the entry point is always a single node definition. if parent = self.parentobj - scope = parent.safeevaluate :scope => scope, :resource => options[:resource] + scope = parent.safeevaluate scope, resource end scope = scope.newscope( - :resource => options[:resource], + :resource => resource, :keyword => @keyword, :source => self, :namespace => "" # nodes are always in "" @@ -36,7 +28,7 @@ class Puppet::Parser::AST # And then evaluate our code if we have any if self.code - @code.safeevaluate(:scope => scope) + @code.safeevaluate(scope) end return scope |