summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-06-16 18:37:04 -0700
committerLuke Kanies <luke@puppetlabs.com>2011-07-15 11:52:12 -0700
commitb3c155430965280ab59b1dd70c020c6da3396fc9 (patch)
tree2e6300bb4dd5394a996aecfb83cd3ce97761672a /lib/puppet/parser
parent9d608ea176224f38c6af349883065d9363dd1bb1 (diff)
downloadpuppet-b3c155430965280ab59b1dd70c020c6da3396fc9.tar.gz
puppet-b3c155430965280ab59b1dd70c020c6da3396fc9.tar.xz
puppet-b3c155430965280ab59b1dd70c020c6da3396fc9.zip
Adding Scope#include? method
This is primarily for Hiera/DataLibrary support, but is a decent idea regardless. 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 711655e44..7b75ca86b 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -87,6 +87,10 @@ class Puppet::Parser::Scope
@compiler.node.name
end
+ def include?(name)
+ self[name] != :undefined
+ end
+
# Is the value true? This allows us to control the definition of truth
# in one place.
def self.true?(value)