From 744cd45378384d33b3118351536e70cd6ea8370d Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 11 Feb 2008 18:13:51 -0600 Subject: Added a 'tagged?' method to the Tagging module. --- lib/puppet/util/tagging.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/tagging.rb b/lib/puppet/util/tagging.rb index 25d74c420..9abb3fb2b 100644 --- a/lib/puppet/util/tagging.rb +++ b/lib/puppet/util/tagging.rb @@ -19,6 +19,11 @@ module Puppet::Util::Tagging qualified.collect { |name| name.split("::") }.flatten.each { |tag| @tags << tag unless @tags.include?(tag) } end + # Are we tagged with the provided tag? + def tagged?(tag) + defined?(@tags) and @tags.include?(tag.to_s) + end + # Return a copy of the tag list, so someone can't ask for our tags # and then modify them. def tags -- cgit