Class: Cucumber::Ast::Tags

Inherits:
Object show all
Defined in:
lib/cucumber/ast/tags.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, tag_names) ⇒ Tags

Returns a new instance of Tags.



8
9
10
# File 'lib/cucumber/ast/tags.rb', line 8

def initialize(line, tag_names)
  @line, @tag_names = line, tag_names
end

Instance Attribute Details

#tag_namesObject (readonly)

Returns the value of attribute tag_names.



6
7
8
# File 'lib/cucumber/ast/tags.rb', line 6

def tag_names
  @tag_names
end

Instance Method Details

#accept(visitor) ⇒ Object



12
13
14
15
16
17
# File 'lib/cucumber/ast/tags.rb', line 12

def accept(visitor)
  return if Cucumber.wants_to_quit
  @tag_names.each do |tag_name|
    visitor.visit_tag_name(tag_name)
  end
end

#accept_hook?(hook) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/cucumber/ast/tags.rb', line 19

def accept_hook?(hook)
  Gherkin::TagExpression.new(hook.tag_expressions).eval(@tag_names)
end

#to_sexpObject



23
24
25
# File 'lib/cucumber/ast/tags.rb', line 23

def to_sexp
  @tag_names.map{|tag_name| [:tag, tag_name]}
end