Class: Cucumber::Parser::GherkinBuilder::ScenarioOutlineBuilder

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



255
256
257
# File 'lib/cucumber/parser/gherkin_builder.rb', line 255

def add_child(child)
  children << child
end

#add_examples(examples_section, node) ⇒ Object



246
247
248
249
# File 'lib/cucumber/parser/gherkin_builder.rb', line 246

def add_examples(examples_section, node)
  @examples_sections ||= []
  @examples_sections << [examples_section, node]
end

#childrenObject



259
260
261
# File 'lib/cucumber/parser/gherkin_builder.rb', line 259

def children
  @children ||= []
end

#result(background, language, feature_tags) ⇒ Object



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/cucumber/parser/gherkin_builder.rb', line 228

def result(background, language, feature_tags)
  scenario_outline = Ast::ScenarioOutline.new(
    language,
    location,
    background,
    comment,
    tags,
    feature_tags,
    node.keyword,
    node.name,
    node.description,
    steps(language),
    examples_sections
  )
  scenario_outline.gherkin_statement(node)
  scenario_outline
end

#steps(language) ⇒ Object



251
252
253
# File 'lib/cucumber/parser/gherkin_builder.rb', line 251

def steps(language)
  children.map { |child| child.result(language) }
end