Class: Lucid::AST::Tags
Overview
:nodoc:
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #accept_hook?(hook) ⇒ Boolean
-
#initialize(line, tags) ⇒ Tags
constructor
A new instance of Tags.
- #to_sexp ⇒ Object
Constructor Details
#initialize(line, tags) ⇒ Tags
Returns a new instance of Tags.
8 9 10 |
# File 'lib/lucid/ast/tags.rb', line 8 def initialize(line, ) @line, @tags = line, end |
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/lucid/ast/tags.rb', line 6 def @tags end |
Instance Method Details
#accept(visitor) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lucid/ast/tags.rb', line 12 def accept(visitor) visitor.(self) do @tags.each do |tag| visitor.visit_tag_name(tag.name) end end end |
#accept_hook?(hook) ⇒ Boolean
20 21 22 |
# File 'lib/lucid/ast/tags.rb', line 20 def accept_hook?(hook) Gherkin::TagExpression.new(hook.tag_expressions).evaluate(@tags) end |
#to_sexp ⇒ Object
24 25 26 |
# File 'lib/lucid/ast/tags.rb', line 24 def to_sexp @tags.map{|tag| [:tag, tag.name]} end |