lib/gurke/configuration.rb in gurke-2.2.2 vs lib/gurke/configuration.rb in gurke-2.3.0
- old
+ new
@@ -83,9 +83,27 @@
def initialize(mod, opts)
@mod = mod
@opts = opts
end
+
+ def tags
+ @tags ||= begin
+ tags = opts.fetch(:tags, [])
+ tags = [tags] unless tags.is_a?(Array)
+ tags
+ end
+ end
+
+ def match?(tags)
+ return true if self.tags.empty?
+
+ self.tags.each do |tag|
+ return true if tags.include?(tag.to_s)
+ end
+
+ false
+ end
end
# @api private
class HookSet
def initialize