class Cucumber::Core::Ast::Feature

Represents the root node of a parsed feature.

Attributes

background[R]
comments[R]
description[R]
feature_elements[R]
keyword[R]
language[R]
location[R]
tags[R]

Public Class Methods

new(language, location, comments, tags, keyword, name, description, feature_elements) click to toggle source
# File lib/cucumber/core/ast/feature.rb, line 20
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

Public Instance Methods

children() click to toggle source
# File lib/cucumber/core/ast/feature.rb, line 32
def children
  @feature_elements
end
short_name() click to toggle source
# File lib/cucumber/core/ast/feature.rb, line 36
def short_name
  first_line = name.split(/\n/)[0]
  if first_line =~ /#{language.feature_keywords}:(.*)/
    $1.strip
  else
    first_line
  end
end

Private Instance Methods

description_for_visitors() click to toggle source
# File lib/cucumber/core/ast/feature.rb, line 47
def description_for_visitors
  :feature
end