Class: Cucumber::Parser::GherkinBuilder::BackgroundBuilder

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



186
187
188
# File 'lib/cucumber/parser/gherkin_builder.rb', line 186

def add_child(child)
  children << child
end

#childrenObject



190
191
192
# File 'lib/cucumber/parser/gherkin_builder.rb', line 190

def children
  @children ||= []
end

#result(language) ⇒ Object



168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/cucumber/parser/gherkin_builder.rb', line 168

def result(language)
  background = Ast::Background.new(
    language,
    location,
    comment,
    node.keyword,
    node.name,
    node.description,
    steps(language)
  )
  background.gherkin_statement(node)
  background
end

#steps(language) ⇒ Object



182
183
184
# File 'lib/cucumber/parser/gherkin_builder.rb', line 182

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