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/function.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/function.rb')
-rw-r--r-- | lib/puppet/parser/ast/function.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 0cd1fff62..63d7c7abf 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -7,18 +7,11 @@ class Puppet::Parser::AST @settor = true - def evaluate(hash) + def evaluate(scope) # We don't need to evaluate the name, because it's plaintext + args = @arguments.safeevaluate(scope) - # Just evaluate the arguments - scope = hash[:scope] - - args = @arguments.safeevaluate(:scope => scope) - - #exceptwrap :message => "Failed to execute %s" % @name, - # :type => Puppet::ParseError do - return scope.send("function_" + @name, args) - #end + return scope.send("function_" + @name, args) end def initialize(hash) |