Sha256: 7ee4639233c03f650999a5624771f50e485fa77decfb57f7dd9cc52fc4342053

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

module Cucumber
  module Ast
    # Holds the names of tags parsed from a feature file:
    #
    #   @invoice @release_2
    #
    # This gets stored internally as <tt>["invoice", "release_2"]</tt>
    #
    class Tags
      def initialize(line, tag_names)
        @line, @tag_names = line, tag_names
      end

      def has_tags?(tags)
        (@tag_names & tags).any?
      end

      def accept(visitor)
        @tag_names.each do |tag_name|
          visitor.visit_tag_name(tag_name)
        end
      end
      
      def to_sexp
        @tag_names.map{|tag_name| [:tag, tag_name]}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aslakhellesoy-cucumber-0.2.3.3 lib/cucumber/ast/tags.rb