summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-06-16 18:41:19 -0700
committerLuke Kanies <luke@puppetlabs.com>2011-07-15 11:52:16 -0700
commit3b2a24602d11d4ca2f7e761fb831f126ecf2de62 (patch)
treea8cb2e1a42d5cf1a8483d3e127ff5348ae72a22a /lib/puppet/parser
parentb3c155430965280ab59b1dd70c020c6da3396fc9 (diff)
downloadpuppet-3b2a24602d11d4ca2f7e761fb831f126ecf2de62.tar.gz
puppet-3b2a24602d11d4ca2f7e761fb831f126ecf2de62.tar.xz
puppet-3b2a24602d11d4ca2f7e761fb831f126ecf2de62.zip
Adding Scope#each method
The capability was already there via to_hash, and Enumerable was already included, but this method was missing. Given the kind of hacking RI is doing, this seemed appropriate. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/scope.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 7b75ca86b..3a87f964b 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -82,6 +82,10 @@ class Puppet::Parser::Scope
compiler.catalog
end
+ def each
+ to_hash.each { |name, value| yield(name, value) }
+ end
+
# Proxy accessors
def host
@compiler.node.name