Class: Cucumber::Parser::GherkinBuilder::FeatureBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/cucumber/parser/gherkin_builder.rb

Instance Method Summary collapse

Methods inherited from Builder

#initialize

Constructor Details

This class inherits a constructor from Cucumber::Parser::GherkinBuilder::Builder

Instance Method Details

#add_child(child) ⇒ Object



151
152
153
# File 'lib/cucumber/parser/gherkin_builder.rb', line 151

def add_child(child)
  children << child
end

#background_builder=(builder) ⇒ Object



147
148
149
# File 'lib/cucumber/parser/gherkin_builder.rb', line 147

def background_builder=(builder)
  @background_builder = builder
end

#childrenObject



155
156
157
# File 'lib/cucumber/parser/gherkin_builder.rb', line 155

def children
  @children ||= []
end

#result(language) ⇒ Object



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/cucumber/parser/gherkin_builder.rb', line 130

def result(language)
  background = background(language)
  feature = Ast::Feature.new(
    location,
    background,
    comment,
    tags,
    node.keyword,
    node.name.lstrip,
    node.description.rstrip,
    children.map { |builder| builder.result(background, language, tags) }
  )
  feature.gherkin_statement(node)
  feature.language = language
  feature
end