Represents the root node of a parsed feature.
# File lib/cucumber/core/ast/feature.rb, line 19 def initialize(language, location, comments, tags, keyword, name, description, feature_elements) @language = language @location = location @background = BackgroundFinder.new(feature_elements).result @comments = comments @tags = tags @keyword = keyword @name = name @description = description @feature_elements = feature_elements end
# File lib/cucumber/core/ast/feature.rb, line 31 def children @feature_elements end
# File lib/cucumber/core/ast/feature.rb, line 35 def short_name first_line = name.split(/\n/)[0] if first_line =~ /#{language.feature_keywords}:(.*)/ $1.strip else first_line end end
# File lib/cucumber/core/ast/feature.rb, line 44 def to_sexp sexp = [:feature, file, name] comment = @comment.to_sexp sexp += [comment] if comment tags = @tags.to_sexp sexp += tags if tags.any? sexp += @feature_elements.map{|fe| fe.to_sexp} sexp end
# File lib/cucumber/core/ast/feature.rb, line 56 def description_for_visitors :feature end